I am developing a whois app for my self to maintain expiry dates of my country level domains (PK). Our PKNIC provider doesn't allow any API or XML to get any such data so i googled found this code that could work now i need a little more code to retrieve only expiry date into a text box.
<?php
$postdata = http_build_query(
array(
'name' => 'google.com.pk',
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://pk5.pknic.net.pk/pk5/lookup.PK', false, $context);
//print_r($result);
echo $result;
?>
Using the above code i get the results something like this..
<tr>
<td> </td>
<td background="img/bg_diagnol.gif"><div align="right" class="style2">Create Date:</div></td>
<td> </td>
<td background="img/square.gif"><span xclass="TD_small">2003-03-05</span></td>
</tr>
<tr>
<td> </td>
<td background="img/bg_diagnol.gif"><div align="right" class="style2">Expire Date: </div></td>
<td> </td>
<td background="img/square.gif">2013-03-05</td>
</tr>
<tr>
<td> </td>
<td background="img/bg_diagnol.gif"> </td>
<td> </td>
<td background="img/square.gif"> </td>
</tr>
<tr>
<td> </td>
<td background="img/bg_diagnol.gif"><div align="right" class="style2">Agent Organization:</div></td>
<td> </td>
<td background="img/square.gif">MarkMonitor <!--
<span class="footer"></span>
-->
</td>
Now i just want to retrieve the Domain Expiry Date, is it possible ? Something maybe like
$('td').find('Expire Date:').after().html
Or is there any regx i can search for date format and copy into text box ?