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:
Code:
$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: