Changes

Jump to: navigation, search

Understanding PHP Variable Types

28 bytes added, 14:17, 13 May 2009
no edit summary
In this chapter we will look at the PHP ''integer'', ''string'', ''float'' and ''boolean'' variable types. Since the the ''array'' and ''object'' types are slightly more complex entities we will devote subsequent chapters to them later in the book (see [[PHP Arrays]] and [[PHP Object Oriented Programming]]).
== The PHP Integer Variable Type ==
Integer variables are able to hold a whole number in the range of -2147483648 to 2147483647. Negative values can be asssigned assigned by placing the minus (-) sign after the assignment operator and before the number. If the value assigned to an integer type variable moves outside the supported range, either via assignment or mathematical calculation, the variable type is automatically converted to a floating point type.
The following examples assign integers to variables:
== The PHP Float Variable Type ==
Floating point variables contain numbers that require the use of decimal places. In addition, float variables can store whole numbers up to higher values than the integer variable type (such as 1.067, 0.25, 423454567098, 84664435.9576). Floating point variable creation and intialization initialization examples are as follows:
<pre>
</pre>
You can also ''escape'' quotes in your string by preceeding preceding them with a backslash (\), especially useful if your string contains both single and double quotes of its own that would otherwise confuse the PHP pre-processor:
<pre>
?>
</pre>
 
<google>BUY_PHP_BOTTOM</google>

Navigation menu