shams Posted March 27, 2006 Share Posted March 27, 2006 hi,this is the a php code but the integer part doesn't show any ouput:<html><head> <title>PHP Test</title></head><body><?php$bool = TRUE; // a boolean$str = "foo"; // a string$int = 12; // an integerecho gettype($bool); // prints out "boolean"echo gettype($str); // prints out "string"// If this is an integer, increment it by fourif (is_int($int)) { $int += 4;}?></body></html>this is the browser ouput:booleanstringany help please? Quote Link to comment https://forums.phpfreaks.com/topic/5905-is-this-code-error/ Share on other sites More sharing options...
Guest footballkid4 Posted March 27, 2006 Share Posted March 27, 2006 Simple: your script doesn't tell the server to display any output. All you're doing is simply adding 4 to the integer that you already have. You would use:[code]<?php echo $int;?>[/code]for the integer output. Quote Link to comment https://forums.phpfreaks.com/topic/5905-is-this-code-error/#findComment-21085 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.