In our previous lesson, we saw only a single line of code
echo "this is my PHP enabled page";
What is done by this code? It simply display the text "this is my PHP enabled page" to the browser.
Now that we have learn the "echo"
thing, we are ready to do something more advanced.
PHP Variable
What is variable?? If you something like $var
or $name
or $pass
, that how variables looks like in PHP. Variable stores data in your program. For example, we want to store a name "John", we could say:
$myName="John";
$myName
which is a variable, store the text for latter use. Now to display the content of the variable, we say:
echo "Hi, my name is ".$myName;
No comments:
Post a Comment