loren646 Posted March 25, 2013 Share Posted March 25, 2013 <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" 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. 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). 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...
loren646 Posted March 25, 2013 Author Share Posted March 25, 2013 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 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
Archived
This topic is now archived and is closed to further replies.