How To Declare An Integer In Php

RegisterLogin
How To Declare An Integer In Php
Post Description: Im Interested In Knowing About Declaring One Integer Value In My Php Script For Using In A Math Project
Tags: How, To, Declare, An, Integer, In, Php
This Post Was Posted On Nov 05, 2009 By Henrymole56 #2689
im starting to learn about php now that i have my website running with php. im working on a math project and i need to know how i can declare an integer value, i already know how to declare a string, but how do you do an integer?
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
Mrinal
#5306 1
nice example..
Jul 07, 2011 Reply Report abuse
gerlin
#4339 2
how about this sample php code:

<?php
$str = "10";
$num = (int)$str;
echo $num * 5;
?>


in addition, did you know you can use is_int() function to find out whether the type of a variable is integer or not. here's an example:

if (is_int($num)) {
echo "is integer\n";
} else {
echo "is not an integer\n";
}
Aug 12, 2010 Reply Report abuse
henrui
#4338 3
can you give me an example of how to use it?
Aug 12, 2010 Reply Report abuse
shaffy
#4336 4
thanks..its good
Aug 11, 2010 Reply Report abuse
jakzen
#2713 5
i think you can use:

(int)

try it
Nov 05, 2009 Reply Report abuse
Leave Your Comments...
©2011 Webune Forums - Mon Dec 19, 2011 2:25 pm
Powered by: Webune Forums V3