|
Posted by Gilles Ganault on 05/07/07 23:30
Hello
I went through some examples, tried a bunch of things... but still
can't figure out why I can't extract the TITLE section of a web page
using preg_replace():
-----------
<?php
$url = "http://www.cnn.com";
$response = file_get_contents($url);
$output=preg_replace("|<title>(.+?)</title>|smiU",
"TITLE=$1",
$response);
$fp = fopen ("output.html", "w");
fputs ($fp,$output);
fclose($fp);
-----------
Any idea?
Thanks!
Navigation:
[Reply to this message]
|