I'm writing a PHP script that will fetch specific codes from the other site.
All is done and its fetching a div which has a class and showing it on my page.
$title = '#\<div class="detailBox"\>(.+?)\<\/div\>#s';
preg_match($title, $page, $titles);
echo $titles[0];
But when I try to fetch from a table it shows nothing
The content on the other site is like this:
<tr>
<th scope="row">開催時間</th>
<td>10:30~17:00</td>
</tr>
And I'm using this code to fetch it:
$date = '#\<tr\><th scope="row"\>開催時間<\/th\><td\>(.+?)\<\/td\><\/tr\>#s';
preg_match($date, $page, $dates);
echo $dates[0];
I have tried $date = '#\<th scope="row"\>開催時間<\/th\>#s';
and it works but not if I add <td>
in it.
What I'm doing wrong?