sandy1028 Posted September 5, 2011 Share Posted September 5, 2011 PHP Warning: fopen(Staff map (b&w) by AVERY EASTER<br/>Canon plant<br/>) function getJpeg($img) { $handle = fopen($img, "rb") or die("Invalid file stream."); ---- } sometimes, $img variable doesn't have the valid URL. Looks something like fopen(Staff map (b&w) by AVERY EASTER<br/>Canon plant<br/>) So it doesn't execute the further code. How to avoid this. Please suggest. Link to comment https://forums.phpfreaks.com/topic/246449-php-warning/ Share on other sites More sharing options...
berridgeab Posted September 5, 2011 Share Posted September 5, 2011 Your $img has been passed html encoded values. If you decode your name you will have the correct name which should be Staff map (b&w) by AVERY EASTER<br/>Canon plant<br/>. getJpeg(html_entity_decode($img)); Link to comment https://forums.phpfreaks.com/topic/246449-php-warning/#findComment-1265648 Share on other sites More sharing options...
sandy1028 Posted September 6, 2011 Author Share Posted September 6, 2011 This doesn't work. Is there any other way to check if file exists or not. URL which needs to be passed is remote URL and file_exists() doesn't work. Link to comment https://forums.phpfreaks.com/topic/246449-php-warning/#findComment-1265871 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.