3) { printf("end of demo.\n"); break; } } function parse1($url) { $v = file_get_contents($url); $v = mb_convert_encoding($v, 'UTF-8', 'EUC-JP'); $v = preg_replace("/\n/", "", $v); $r = array(); if (!preg_match('|
.*?
(.*?)
|', $v, $matches)) { return null; } $r['title'] = $matches[1]; if (!preg_match('|

.*?
(.*?)
(.*?)

|', $v, $matches)) { return null; } $r['e1'] = $matches[1]; $r['es'] = $matches[2]; if (!preg_match('|

.*?(【.*?)
.*?(【.*?)
.*?

|', $v, $matches)) { return null; } $r['j1'] = $matches[1]; $r['js'] = $matches[2]; printf("%s\t", $r['title']); printf("%s\t", $r['e1']); printf("%s\t", $r['es']); printf("%s\t", $r['j1']); printf("%s\n", $r['js']); flush(); if (!preg_match('||', $v, $matches)) { return null; } return $matches[1]; }