Help taking a string from a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello List,

I made something work, but probably in the most crappy way possible.

My goal is to take just the HTML for the image and link from the Flickr badge js script.

This is what I did, please help me do in a better way. I'd appreciate good sources to read to learn to strip stuff away and just get specific parts as well. I never know which of the str functions to use.

<?
// allow retrieval of external web source
ini_set('allow_url_fopen',1);

// get flickr js file
$photo = file_get_contents("http://www.flickr.com/badge_code_v2.gne? count=1&display=latest&size=m&layout=h&source=user&user=91667218% 40N00");

//get rid of all the crap except for the image tags
$photo = strstr($photo, '<a');
list($image, $trash) = explode("'", $photo);
$image = ereg_replace("</td>","", $image);
?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux