View Single Post
Old 01-23-2013, 01:17 PM   PM User | #1
Scharfheimlich
New Coder

 
Join Date: Jun 2011
Posts: 15
Thanks: 5
Thanked 0 Times in 0 Posts
Scharfheimlich is an unknown quantity at this point
How to save results in .csv file?

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...
Scharfheimlich is offline   Reply With Quote