Register|Login

Have a question? Click here to ask the community.

Tutorial 4 – PHP Variables

| In: 4. Variables | 17,788 views

Video Tutorial


Video Source Code

1
2
3
4
5
6
7
8
9
10
11
12
<?php
// File Description: PHP - Variables Tutorial
$variableName = "Robert";
$a_Num = 10;
$aNumber = 9000;
 
$xValue = 8;
 
$userName;
$user_name;
 
?>

Common Rules For Naming Variables:
  • A variable name must start with an underscore “_” or letter
  • A variable name can only include alpha-numeric characters and underscores (a-z, A-Z, 0-9 and _ )
  • A variable name cannot contain spaces. If the variable is more than one word, separate it with capitalization or with an underscore.

Comment Form

You must be logged in to post a comment.