Hello,
I have this working script and I would like to save those results in csv. Can anyone help me how to do that?
PHP Code:
<?php
$url="http://www.ebay.com/sch/Diamonds-Natural-/3824/i.html?_dcat=3824&Clarity=IF%7CVVS1%7CVVS2&_ssn=gemstoneking&_pgn=2&_skc=200&rt=nc";
$data=file_get_contents($url);
$data = strip_tags($data,"<a>");
$d = preg_split("/<\/a>/",$data);
foreach ( $d as $k=>$u ){
if( strpos($u, "<a href=") !== FALSE ){
$u = preg_replace("/.*<a\s+href=\"/sm","",$u);
$u = preg_replace("/\".*/","",$u);
print $u."\n";
}
}
Thanks...