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. Quote 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)); Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/246449-php-warning/#findComment-1265871 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.