Difference between revisions of "Test"

From Opengenome.net
 
Line 1: Line 1:
&lt;?php <br />
+
 
$a_bool = TRUE; // a boolean <br />
 
$a_str = &quot;foo&quot;; // a string <br />
 
$a_str2 = 'foo'; // a string <br />
 
$an_int = 12; // an integer <br />
 
<br />
 
echo gettype($a_bool); // prints out: boolean <br />
 
echo gettype($a_str); // prints out: string <br />
 
<br />
 
// If this is an integer, increment it by four <br />
 
if (is_int($an_int)) { <br />
 
$an_int += 4; <br />
 
} <br />
 
<br />
 
// If $bool is a string, print it out <br />
 
// (does not print out anything) <br />
 
if (is_string($a_bool)) { <br />
 
echo &quot;String: $a_bool&quot;; <br />
 
} <br />
 
?&gt; <br />
 

Revision as of 20:49, 3 November 2006