PHP – Setting Variables

Variables in PHP can be set without needing to be declared.

 

<?php

$string = “Hello World”;
$int = 1;
$float = 2.2;

print “<h1>String</h1>”;
print $string;
print “<h1>Int</h1>”;
print $int;
print “<h1>Float</h1>”;
print $float;
?>

 

Be the first to comment

Leave a Reply