|
 |
|
|
|
|
|
How to define variables and send their data to browser as out put.
php code starts with <? and ends with ?> which differenciate it with different scripts within one pages.
in this beginers' short tutorial we will learn how to define a variable and how to access it.
| CODE |
<?
$myvar="This is my text";
print $myvar;
?>
|
$myvar="This is my text";
It is automatically detected that this variable can hold text data type not any other type as integers etc.
if we need to set that variable to treat as integer, we define it as
$myvar=15;
remember not to set quotes (" ") when defining it as integer.
print $myvar;
it will simply send the data contained in $myvar to your clint browser.
|
|
|
|