I'm using curl to get my values from a site name PKNiC
My code is:
function _isCurl() {
return function_exists('curl_version');
}
if (_iscurl()) {
//curl is enabled
$url = "https://pk6.pknic.net.pk/pk5/lookup.PK?name=cat.com.pk&jsonp=?";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
var_dump($output);
// Curl operations finished
} else {
echo "CURL is disabled";
}
Now when I run this program it returns a string to me with whole page print on it as a single string.
I need registrant name
, expiry date
, create date
, contacts
. How do I get those things? I have no idea how it works and it just provide me a single string when I use var_dump
or print_r
or any thing to view it. How to get the record of my choice?