コード例 #1
0
ファイル: get_content.class.php プロジェクト: h3len/Project
 public function get_content_detail($field, $tablename, $array_field, $id)
 {
     $result = array();
     $sql = "SELECT " . $field . " FROM " . DB_PREFIX . $tablename . " WHERE id=" . $id;
     $info = $this->db->query($sql);
     if ($array_field) {
         $array_field_arr = explode(',', $array_field);
     }
     if ($array_field_arr) {
         while ($row = $this->db->fetch_array($info)) {
             foreach ($array_field_arr as $v) {
                 $row[$v] = unserialize($row[$v]) ? unserialize($row[$v]) : $row[$v];
             }
             $result = $row;
         }
     } else {
         while ($row = $this->db->fetch_array($info)) {
             $result = $row;
         }
     }
     $result = to_htmlspecialchars_decode($result);
     return $result;
 }
コード例 #2
0
ファイル: functions.php プロジェクト: h3len/Project
function to_htmlspecialchars_decode($data)
{
    if (is_array($data)) {
        foreach ($data as $k => $v) {
            $data[$k] = to_htmlspecialchars_decode($v);
        }
    } else {
        $data = htmlspecialchars_decode($data);
    }
    return $data;
}