Sniffy Posted July 14, 2007 Share Posted July 14, 2007 Ok, on my expiriment I am trying to load images by putting their urls in a text file.Screenshots.php <?$filename = "screenshots.txt";$fileopen = fopen($filename, "r");$fileread = fread($fileopen, filesize($filename));$arr = split(" + ", $fileread);$ac = count($arr);for($i = 0; $i < $ac; $i++){ echo "<img src='".$arr[i]."' /><br /><br />";}fclose($fileopen);?> screenshots.txt http://img207.imageshack.us/img207/127/elb3r3th14px4.jpg + http://http://img151.imageshack.us/img151/5935/kyallanaandnamoor1ek5.jpg how come it won't display my images? Link to comment Share on other sites More sharing options...
justsomeguy Posted July 14, 2007 Share Posted July 14, 2007 What does the HTML code that gets generated look like? Link to comment Share on other sites More sharing options...
Sniffy Posted July 14, 2007 Author Share Posted July 14, 2007 One image with an x over it like an error but i test the url and it works. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 14, 2007 Share Posted July 14, 2007 I mean look at the <img> tag that gets generated by PHP and see why it's not writing out the src correctly. Link to comment Share on other sites More sharing options...
zppblood Posted July 15, 2007 Share Posted July 15, 2007 I don't know, but I think it's because of thissplit — Split string into array by regular expressionTry using explode(" + ", $fileread); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.