Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 23rd Mar 2015, 11:54 AM   #1
SpiderCon
War Room Member
 
Join Date: 2012
Location: Earth
Posts: 194
Thanks: 30
Thanked 17 Times in 16 Posts
Default
How to Save Results in a File
Share on: 
fb share twitter share gplus share more share

This piece of code gets all the required links, now I want to save them in a file and can't figure out how to do this. Any help would be appreciated.


Code:
<?php

include_once('simple_html_dom.php');

// Get Contents with Multiple Links

$page1 = file_get_html('http://www.example.com/link1.html');

$page2 = file_get_html('http://www.example.com/link2.html');

$page3 = file_get_html('http://www.example.com/link3.html');


$html = str_get_html($page1.$page2.$page3);

// Find all links in cat_listings_title div
 
foreach($html->find('a.cat_listings_title') as $element) 
      echo $element->href . '<br>'; 
	   

?>
hassan007 is offline  
Unread 23rd Mar 2015, 01:02 PM   #2
Active Warrior
Registered Member
 
Join Date: 2013
Posts: 58
Thanks: 4
Thanked 16 Times in 12 Posts
Lightbulb
Re: How to Save Results in a File
Share on: 
fb share twitter share gplus share more share

Here you go: http://pastebin.com/7a3LtJNj
geekSoftware is offline  
The Following User Says Thank You to geekSoftware For This Useful Post:
Unread 24th Mar 2015, 04:27 AM   #3
SpiderCon
War Room Member
 
Join Date: 2012
Location: Earth
Posts: 194
Thanks: 30
Thanked 17 Times in 16 Posts
Default
Re: How to Save Results in a File
Share on: 
fb share twitter share gplus share more share

Thank you GeekSoftware... You are a lifesaver man.
hassan007 is offline  
Closed Thread


Bookmarks

Tags
file, results, save


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 01:08 PM.