我有一个网站的源代码(从 file_get_contents 获取)。
看起来是这样:
<td id=dat>
2013-09-22
</td>
<td>
<a href="http://www.test.at/results/show_results.php?v=12252"
target=_blank>bbbbbbb
</a>
</td>
<td id=dat>
2013-09-22
</td>
<td>
<a href="http://www.test.at/results/show_results.php?v=12231"
target=_blank>Tlalalala
</a>
</td>
<td id=dat>
2013-09-22
</td>
<td>
<a href="http://www.test.at/results/show_results.php?v=12234"
target=_blank>Tzzzzz
</a>
</td>
现在我需要做一个正则表达式,这样我就可以拥有它......
<?php
$JSON = array(
"results" => array(
array(
"title" => "bbbbbbb",
"url" => "http://www.test.at/results/show_results.php?v=12252",
"date" => "2013-09-22"
),
array(
"title" => "Tlalalala",
"url" => "http://www.test.at/results/show_results.php?v=12231",
"date" => "2013-09-22"
),
array(
"title" => "Tzzzzz",
"url" => "http://www.test.at/results/show_results.php?v=12234",
"date" => "2013-09-22"
),
),
);
echo json_encode($JSON);
?>
有人能帮我吗 ?