spdwrench Posted September 5, 2007 Share Posted September 5, 2007 $top_thumbs .= parseVariables("templates/mainthumbs.html",0); I have this code in a php file it keeps adding an image to the variable $top_thumbs so say I had 10 images 100 pixels accross how could I get this from the $top_thumbs variable? I need to know how many pixels accross the totall of the variable (which is multiple thumbnails) so say I had 10 thumbs of 100 pixels accross... I need the result 1000 how can I get this number from $top_thumbs???? Please give me an idea.... Paul Quote Link to comment https://forums.phpfreaks.com/topic/68082-how-can-i-get-the-table-length-of-this-string/ Share on other sites More sharing options...
cooldude832 Posted September 5, 2007 Share Posted September 5, 2007 look into the gd library to retrieve the image size attributes. Quote Link to comment https://forums.phpfreaks.com/topic/68082-how-can-i-get-the-table-length-of-this-string/#findComment-342206 Share on other sites More sharing options...
trq Posted September 5, 2007 Share Posted September 5, 2007 Are you adding to this $top_thumbs variable within a loop? You simply need to add a counter to the loop. Quote Link to comment https://forums.phpfreaks.com/topic/68082-how-can-i-get-the-table-length-of-this-string/#findComment-342207 Share on other sites More sharing options...
spdwrench Posted September 5, 2007 Author Share Posted September 5, 2007 yes I am adding in a loop I cant simply add a counter because the image widths vary in size... do I have to count the image sizes one by one....??? I am looking for a way to get the size from the variable is this not possible? otherwise if I do need to put it in the loop.. could you give me an example of how to get the image size from each photo the code that actually gets the image is like this $profile_image = sysGetThumbnail("photos/{$person[$curr][filename_1]}"); so how do I get the image size from this?? any help is appreciated Paul Quote Link to comment https://forums.phpfreaks.com/topic/68082-how-can-i-get-the-table-length-of-this-string/#findComment-342214 Share on other sites More sharing options...
trq Posted September 5, 2007 Share Posted September 5, 2007 I am looking for a way to get the size from the variable is this not possible? Your variables are simply string. Where would that get the info you want from? You'll need to look into the gd libraries getimagesize function. Quote Link to comment https://forums.phpfreaks.com/topic/68082-how-can-i-get-the-table-length-of-this-string/#findComment-342217 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.