I am wondering if someone could help me out. I am trying to just grab a url from a html file. I can search the file easy enough but then once I get the url I can't cut it down to just the url.
The code is below:
Code: Select all
<?PHP
$source = file_get_contents('http://www.apple.com/trailers/independent/fearsofthedark/');
$search = "<img src=\"";
$newText = substr($source,strpos($source, $search)+strlen($search), 100);
print $newText;
?>
http://images.apple.com/trailers/independent/images/fearsofthedark_200809251636.jpg" width="134" hei
I need it to be cut at " and just have http://images.apple.com/trailers/independent/images/fearsofthedark_200809251636.jpg
Anyone have any ideas?
Thanks!