View unanswered posts | View active topics It is currently Wed Nov 29, 2023 6:19 pm

Reply to topic  [ 2 posts ] 
 web crawler 
Author Message
Junior Member

Joined: Sun Jul 01, 2007 5:14 am
Posts: 3
Post web crawler
I am trying to write a PHP web crawler but am having problems. I want to start off by getting the title and other elements of a page. This is what i have so far:

$str = "a <title>bla bla this is the title</title> a";

echo "the title is: ".preg_replace("/^<title>(.*)<\/title>$/","it works",$str);
$title = split("/^<title>(.*)<\/title>$/",$str);
echo "\n<p>".print_r($title);

However this only shows one element of the array, which is the whole string.
Can someone please show me what i am doing wrong?:confused:

Sun Jul 01, 2007 5:26 am
Report this post
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 0 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
© Copyright 2003-2008 The ultimate PHP Editor and PHP IDE site.