When you declare a variable, you assign a value to it:
$var_name = value;
To access the value of a variable that's already been assigned, simply specify the dolalr sign ($) followed by the variable name, and use it as you would the value of the variable in your code.
You don't have to clean up your varaibles when your program finishes. They're temporary because PHP automatically cleans them up when you're done using them.
<html> <head> <title>PHP</title> <meta Name="Author" Content="Hann So"> </head> <body> <p> <?php $hello = "Hello World!"; $year = 2008; echo $hello; echo $year; ?> </p> </body> </html> |