3raser Posted June 6, 2010 Share Posted June 6, 2010 $size = getimagesize($image.$extension); Why does the above code echo out: 6png instead of 6.png? Quote Link to comment https://forums.phpfreaks.com/topic/204025-period-isnt-included/ Share on other sites More sharing options...
ale8oneboy Posted June 6, 2010 Share Posted June 6, 2010 Does $extension = ".png"; ? Quote Link to comment https://forums.phpfreaks.com/topic/204025-period-isnt-included/#findComment-1068599 Share on other sites More sharing options...
3raser Posted June 6, 2010 Author Share Posted June 6, 2010 Does $extension = ".png"; ? No. Quote Link to comment https://forums.phpfreaks.com/topic/204025-period-isnt-included/#findComment-1068601 Share on other sites More sharing options...
ale8oneboy Posted June 6, 2010 Share Posted June 6, 2010 Try: "$image.$extension" Instead of $image.$extension Wouldn't $image.$extension just join the two variables as a string? Quote Link to comment https://forums.phpfreaks.com/topic/204025-period-isnt-included/#findComment-1068608 Share on other sites More sharing options...
3raser Posted June 6, 2010 Author Share Posted June 6, 2010 Thank you, it works. Quote Link to comment https://forums.phpfreaks.com/topic/204025-period-isnt-included/#findComment-1068618 Share on other sites More sharing options...
monkeybidz Posted June 6, 2010 Share Posted June 6, 2010 How about: $size = getimagesize($image."."$extension); Quote Link to comment https://forums.phpfreaks.com/topic/204025-period-isnt-included/#findComment-1068623 Share on other sites More sharing options...
ignace Posted June 6, 2010 Share Posted June 6, 2010 $size = getimagesize($image.$extension); Why does the above code echo out: 6png instead of 6.png? Because the dot acts as the concatenation-operator (join 2 strings together). If you want an actual dot you need to write it as a string like $image.'.'.$extension Quote Link to comment https://forums.phpfreaks.com/topic/204025-period-isnt-included/#findComment-1068713 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.