We have upgraded our system to latest version of MyBB. We are very sorry for the downtime ! Read More.
Advertise Here | Remove Ads

Rules for PHP variables
  • 0 Vote(s) - 0 Average


PHP Rules for PHP variables
1
Variables are "containers" for storing information.

In PHP, a variable starts with the $ sign, followed by the name of the variable:

PHP Code:
<?php
$text 
"Hello world!";
$num1 5;
$num_2 10.5;
?>

A variable can have a short name (like x and y) or a more descriptive name (age,myname, total_value).

Rules for PHP variables:
  • A variable starts with the $ sign, followed by the name of the variable
  • A variable name must start with a letter or the underscore character
  • A variable name cannot start with a number
  • A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
  • Variable names are case-sensitive ($age and $AGE are two different variables)

[Image: FCgKq6Jl.png]






Forum Jump:


Users browsing this thread:
1 Guest(s)

Advertise Here | Remove Ads