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? 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"; ? 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. 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? 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. 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); 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 Link to comment https://forums.phpfreaks.com/topic/204025-period-isnt-included/#findComment-1068713 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.