Mon Oct 27, 2008 12:38 pm
<?
$type_examples[0] = 123;
$type_examples[1] = 3.14159;
$type_examples[2] = "a string";
$type_examples[3] = "9.990 (begins with number)";
$type_examples[4] = array(9,8,7);
print("<TABLE><TR>");
print("<TH>Original</<TH>");
print("<TH>(int)</<TH>");
print("<TH>(double)</<TH>");
print("<TH>(string)</<TH>");
print("<TH>(array)</<TH></TR>");
for ($index = 0; $index < 5; $index++){
print("<TR><TD>$type_examples[$index]</TD>");
$converted_var =
(int) $type_examples[$index];
print("<TD>$converted_var</TD>");
$converted_var =
(double) $type_examples[$index];
print("<TD>$converted_var</TD>");
$converted_var =
(string) $type_examples[$index];
print("<TD>$converted_var</TD>");
$converted_var =
(array) $type_examples[$index];
print("<TD>$converted_var</TD></TR>");
}
print("</TABLE>");
?>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.