If you have any suggestions or comments, and would prefer using email, please contact me at:
gngabriel29[REMOVETHISANDREPLACEWITHYOU-KNOW-WHAT]ymail.com

September 29, 2008

PHP: Using variables

Filed under: PHP/PHP Basics


We will be learning how to create and display the value of variables, in PHP.

Create and assign values to variables

First, we will create variables, and asign values to these variables.

A variable $name was created and assigned value of “Kira”.
$name=”Kira”

Another variable $age was also created and assigned the value of 16.
$age=16

Display value of variables using echo statement

Next we created echoed or output the values of these variables by using php code of:
echo $name;
echo $age;

Display value of variables in browser

This resulted in the browser showing:
Name is: Kira
Age is: 16

Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>. I unfortunately do not have a spoiler-code, so be sure mark spoilers well.



Anti-spam measure: please retype the above text into the box provided.