chico1st Posted April 27, 2007 Share Posted April 27, 2007 Hi I was wondering how I can turn a string that is "05" into a string that is "5" Thanks Link to comment https://forums.phpfreaks.com/topic/48877-solved-turn-05-5/ Share on other sites More sharing options...
AndyB Posted April 27, 2007 Share Posted April 27, 2007 $x = $x + 0; echo $x; Link to comment https://forums.phpfreaks.com/topic/48877-solved-turn-05-5/#findComment-239553 Share on other sites More sharing options...
boo_lolly Posted April 27, 2007 Share Posted April 27, 2007 $x = $x + 0; echo $x; will this turn $x into an intiger or will it stay a string? why? Link to comment https://forums.phpfreaks.com/topic/48877-solved-turn-05-5/#findComment-239560 Share on other sites More sharing options...
jitesh Posted April 27, 2007 Share Posted April 27, 2007 <?php echo "05"; echo "<br>"; echo (integer)("05"); ?> Link to comment https://forums.phpfreaks.com/topic/48877-solved-turn-05-5/#findComment-239566 Share on other sites More sharing options...
btherl Posted April 27, 2007 Share Posted April 27, 2007 var_dump($var) will tell you the type of a variables. Very handy for those type-related debugging sessions. Link to comment https://forums.phpfreaks.com/topic/48877-solved-turn-05-5/#findComment-239572 Share on other sites More sharing options...
neel_basu Posted April 27, 2007 Share Posted April 27, 2007 $x = 05;//Here $x is Octal $x = 5;//Here $x is Int $x = "05";//Here $x is String $y = (integer)($x);//Now $y is int and is 5 echo gettype($y); Link to comment https://forums.phpfreaks.com/topic/48877-solved-turn-05-5/#findComment-239597 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.