Functions

Started on the old forum in October 2010 · view the original in the archive · old links redirect here

1 reply · 363 views · started 16 years ago · 1 min read

Guest #1

Hey guys thanks for all the previous help you guys have given me im just fiddling with coding again and i was wondering what functions or rather what code would i use to create a very simple php spider which scans web pages for various things firstly using the file_get_contents(); function with a couple other functions included

i0nutzxp Developer · 150 posts #2

that code show u all url's from a page .... u cand extend the code and get more and more ...

<?php
  $original_file = file_get_contents("http://site.com");
  $stripped_file = strip_tags($original_file, "<a>");
  preg_match_all("/<a(?:[^>]*)href=\"([^\"]*)\"(?:[^>]*)>(?:[^<]*)<\/a>/is", $stripped_file, $matches);

foreach($matches[1] as $link)
echo "$link<br/>";
 
?>
<?php unlink('World/Europe/Romania.country'); ?>

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close