/", $body, $match); foreach( $match[0] as $val ) { //絵文字のキーを抜き出す preg_match("/[A-Z0-9]{4}?/", $val, $key); //絵文字を導き出す $emoji = Convert($key[0]); $body = str_replace($val, $emoji, $body); } echo str_replace('%doctype%', $mobile_data['doctype'], $header); echo $body; function GetMoneyStat($id){ global $db; $sql = 'SELECT stat FROM money_stat WHERE id = ?'; $sth = $db->prepare( $sql ); $result = $db->execute( $sth, array( $id ) ); if( DB::isError($result) ) { print $result->getMessage(); return false; } if(!$row = $result->fetchRow()){ return false; }else{ return($row[0]); } } function GetRoomStat($id){ global $db; $sql = 'SELECT stat, DATE_FORMAT( upd_date, "%m/%d %H:%i" ) FROM room_stat WHERE id = ?'; $sth = $db->prepare( $sql ); $result = $db->execute( $sth, array( $id ) ); if( DB::isError($result) ) { print $result->getMessage(); return false; } if(!$row = $result->fetchRow()){ return false; }else{ return($row); } } function GetRoomLabel($id){ global $db; $sql = 'SELECT label FROM room_stat_label WHERE id = ?'; $sth = $db->prepare( $sql ); $result = $db->execute( $sth, array( $id ) ); if( DB::isError($result) ) { print $result->getMessage(); return false; } if(!$row = $result->fetchRow()){ return false; }else{ $row[0] = mb_convert_encoding($row[0], 'SJIS', 'EUC-JP'); } return($row[0]); } ?>