スケジュール

";
fputs($fp2, $head . "\n");
$i = 0;
if ($fp) {
if (flock($fp, LOCK_SH)) {
while (!feof($fp)) {

$line = fgets($fp);

if (strstr($line, '\'schedule_')) {
$day = strip_tags($line);
if (mb_strpos($day, '〜') === false) {
print "no idea";
} else {
$day_start = str_replace('月', '/', explode("〜", $day));
$day_start = preg_replace('/日.*/', '', $day_start);
$day_start = preg_replace('/\r\n/', '', $day_start);
$day_start[1] = str_replace(array("\r\n", "\r", "\n"), '', $day_start[1]);
$day_start[0] = $day_start[0] . "/15";
$day_start[1] = $day_start[1] . "/15";
}
} elseif (strstr($line, 'sched_tblcell_02')) {
$i++;
$info[] = strip_tags($line);
$info = str_replace(array("\r\n", "\r", "\n"), '', $info);
$infomation = implode('/', $info);
print $infomation;
if ($i == 3) {
print "最終";
$start = $title . "(開始)" . "," . $day_start[0] . ",,,,FALSE," ."\"". $infomation . "\"". ",\"ギンレイホール\",TRUE";
$end = $title . "(終了)" . "," . $day_start[1] . ",,,,FALSE," . "\"".$infomation . "\"". ",\"ギンレイホール\",TRUE";
unset($info);
$i = 0;
fputs($fp2, $start . "\n");
fputs($fp2, $end . "\n");
}
} elseif (strstr($line, 'sched_tblcell_01')) {
$title = strip_tags($line);
$title = preg_replace('/\r\n/', '', $title);
}
}
flock($fp, LOCK_UN);
} else {
print('ファイルロックに失敗しました');
}
}

fclose($fp);
fclose($fp2);
?>