Friday, May 21, 2010

WEB DEVELOPMENT In PHP, what type of variable would you use to store a number with a decimal place. Thank you!

PHP variables aren't type cast so you can use the same variable to store a string as you can to store integer or float.





e.g.





%26lt;?


$a = "String";


$b = 23; //integer


$c = 23.21; //float


?%26gt;





If you want to check if a variable is a float or integer you can use is_int() or is_float()


No comments:

Post a Comment