RyanSF07 Posted March 27, 2009 Share Posted March 27, 2009 Hi Guys, I have a script that grabs images at random from a "thumbnails" folder in my directory. They are displayed with: code code.. echo "<img src='$dir/".$files[$rnd]."'>; Do you know how I can see the name of the image? I'd like to be able to see the image name as a $string variable -- but can't figure out how I can see the name of the image when the image itself is echoed. Any ideas? Thanks, Ryan Link to comment https://forums.phpfreaks.com/topic/151450-solved-show-image-title-from-image-variable/ Share on other sites More sharing options...
RyanSF07 Posted March 27, 2009 Author Share Posted March 27, 2009 so, for example, if a picture of a family member is pulled from the folder and ThisFamilyMember'sName.jpg is displayed in a table, is there a way to create ThisFamilyMemeber'sName as a $string variable -- something like -- "file name = $string" Any ideas on how I can do that? Link to comment https://forums.phpfreaks.com/topic/151450-solved-show-image-title-from-image-variable/#findComment-795528 Share on other sites More sharing options...
MadnessRed Posted March 27, 2009 Share Posted March 27, 2009 how about this? $string = explode(".",$files[$rnd]); $string = $string[(sizeof($string)-2)]; Link to comment https://forums.phpfreaks.com/topic/151450-solved-show-image-title-from-image-variable/#findComment-795532 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.