loren646 Posted March 25, 2013 Share Posted March 25, 2013 (edited) <img src="/pics/Dan/40 Allen/4/201232313_33.jpg" alt="40allen" width="400" height="400"><br> <?php $dir = "/pics/Dan/40%20Allen/4/*"; // Open a known directory, and proceed to read its contents foreach(glob($dir) as $file) { echo "filename: $file : filetype: " . filetype($file) . "<br />"; } $files = glob("/pics/Dan/40 Allen/4/*.{jpg,gif,png}", GLOB_BRACE); echo "yo yo".$files[0]; ?> I'm trying different ways using %20 and without using %20. Nothing seems to come up. The html works on top. It only prints the picture from the html and the "yo yo" Edited March 25, 2013 by loren646 Quote Link to comment https://forums.phpfreaks.com/topic/276105-glob-not-coming-up-with-any-results/ Share on other sites More sharing options...
trq Posted March 25, 2013 Share Posted March 25, 2013 Shells use backslashes to escape special characters like spaces. Quote Link to comment https://forums.phpfreaks.com/topic/276105-glob-not-coming-up-with-any-results/#findComment-1420828 Share on other sites More sharing options...
haku Posted March 25, 2013 Share Posted March 25, 2013 To elaborate on that, %20 is used in URLs. I don't believe you will find that convention anywhere else (though someone feel free to step in and correct me if I'm wrong). Quote Link to comment https://forums.phpfreaks.com/topic/276105-glob-not-coming-up-with-any-results/#findComment-1420831 Share on other sites More sharing options...
Solution loren646 Posted March 25, 2013 Author Solution Share Posted March 25, 2013 (edited) it's more than just the space. i tried changing the folder from 40 Allen to 40Allen it still outputs nothing. okay... i removed the first / and it seems to work. SOLVED Edited March 25, 2013 by loren646 Quote Link to comment https://forums.phpfreaks.com/topic/276105-glob-not-coming-up-with-any-results/#findComment-1420840 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.