oraya Posted July 6, 2012 Share Posted July 6, 2012 Is it possible to place to variables into a getimage? list($width, $height, $type, $attr) = getimagesize("image_name.jpg"); So in stead of the image_name.jpg. I'd have something like this list($width, $height, $type, $attr) = getimagesize("$location, $image"); I've googled to find an answer but only found info on getimagesize and not on this question. Any help would be gratefully received, thank you in advane Oray Quote Link to comment https://forums.phpfreaks.com/topic/265288-how-can-i-add-two-variables-to-a-getimagesize/ Share on other sites More sharing options...
trq Posted July 6, 2012 Share Posted July 6, 2012 Of course it's possible, have you tried it? <?php $image = "image_name.jpg"; list($width, $height, $type, $attr) = getimagesize($image); Quote Link to comment https://forums.phpfreaks.com/topic/265288-how-can-i-add-two-variables-to-a-getimagesize/#findComment-1359560 Share on other sites More sharing options...
oraya Posted July 6, 2012 Author Share Posted July 6, 2012 Hi thorpe. thank you for the reply. How would I add a second variable. The first is the directory of the image and the second is the image name. I tried it this way and it doesn't seem to be passing the image and directory to it. I also tried it with a comma still no go. list($width, $height, $type, $attr) = getimagesize($location . $image); Quote Link to comment https://forums.phpfreaks.com/topic/265288-how-can-i-add-two-variables-to-a-getimagesize/#findComment-1359563 Share on other sites More sharing options...
xyph Posted July 6, 2012 Share Posted July 6, 2012 Try getimagesize($location . '/' . $image); Maybe check what those variables contain? Quote Link to comment https://forums.phpfreaks.com/topic/265288-how-can-i-add-two-variables-to-a-getimagesize/#findComment-1359566 Share on other sites More sharing options...
oraya Posted July 6, 2012 Author Share Posted July 6, 2012 Damn discovered why lol.. had quotes around it. Thank you for your help. Oraya Quote Link to comment https://forums.phpfreaks.com/topic/265288-how-can-i-add-two-variables-to-a-getimagesize/#findComment-1359569 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.