([^<]+)<\/title>/', $line, $matches)) { if (preg_match('/([^<]+)</', $line, $matches)) { $title = $matches[1]; } if (!$is_search1) { // if (preg_match('/バックセット(:|\x81\x46)' . $search_str1 . '/', $line)) { if (mb_ereg('バックセット[::]' . $search_str1, $line)) { $is_search1 = true; } } if (!$is_search2) { // if (preg_match('/ビスピッチ[::]' . $search_str2 . '/', $line)) { if (mb_ereg('ビスピッチ[::]' . $search_str2, $line)) { $is_search2 = true; } } if ($is_search1 && $is_search2) { break; } } fclose($fp); if ($is_search1 && $is_search2) { $result_list[] = array('filename' => $filename, 'title' => $title); $hit_count++; } } } } closedir($dh); usort($result_list, 'sortExecute'); $result_html = $hit_count . '件がヒットしました<br /><br />'; foreach ($result_list as $rec) { $result_html .= '<a href="' . $rec['filename'] . '">' . $rec['title'] . '</a><br />'; } } } // トップページ else { } function sortExecute($a, $b) { return strcmp($a['title'], $b['title']); } $search_list1 = ''; $search_list2 = ''; for ($i = 0; $i < count($SEARCH1); $i++) { $selected = $request['search1'] == $i ? ' selected="selected"' : ''; $search_list1 .= '<option value="' . $i . '"' . $selected . '>' . $SEARCH1[$i] . '</option>'; } for ($i = 0; $i < count($SEARCH2); $i++) { $selected = $request['search2'] == $i ? ' selected="selected"' : ''; $search_list2 .= '<option value="' . $i . '"' . $selected . '>' . $SEARCH2[$i] . '</option>'; } //header('Content-type: text/html; charset=Shift_JIS'); $agent = $_SERVER['HTTP_USER_AGENT']; if(preg_match('/DoCoMo/', $agent)){ header('Content-Type: application/xhtml+xml; charset=SJIS'); echo '<!DOCTYPE html PUBLIC "-//i-mode group (ja)//DTD XHTML i-XHTML(Locale/Ver.=ja/1.1) 1.0//EN" "i-xhtml_4ja_10.dtd">'; } else if(preg_match("/^UP.Browser|^KDDI/", $agent)){ header("Content-type: text/html; charset=Shift_JIS"); echo '<!DOCTYPE html PUBLIC "-//OPENWAVE//DTD XHTML 1.0//EN" "http://www.openwave.com/DTD/xhtml-basic.dtd">'; } else if(preg_match("/^J-PHONE|^Vodafone|^SoftBank/", $agent)){ echo '<?xml version="1.0" encoding="Shift_JIS"?>'; header("Content-type: text/html; charset=Shift_JIS"); echo '<!DOCTYPE html PUBLIC "-//J-PHONE//DTD XHTML Basic 1.0 Plus//EN" "xhtml-basic10-plus.dtd">'; } include_once('search.html'); ?>