Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

PHP Variables

Fri Sep 05, 2008 1:53 am

if you are a programmer ,php have a new idea to you.You don't have to determine the type of variable.What you do is just giving the value to variable.
like that $variable_name= value;
just like that , not integer or string before variable name .

variable example

Code:
<?php
$massage
= "my luck number is ";
$mynumber = 4;
  echo "$massage  $mynumber";
?>


the output is :
Code:
my luck number is  4


There some conventions with variables names :
  • PHP variables must start with a letter or underscore "_".
  • PHP variables may only be comprised of alpha-numeric characters and underscores. a-z, A-Z, 0-9, or _ .
  • Variables with more than one word should be separated with underscores. $my_variable
  • Variables with more than one word can also be distinguished with capitalization. $myVariable




Post a reply
  Related Posts  to : PHP Variables
 Local variables vs Instance variables     -  
 Scope Variables in php     -  
 Apache Variables in php     -  
 PHP session variables     -  
 Variables Are Assigned by Value     -  
 Casting Variables in php     -  
 Static Methods and Variables     -  
 Modify Session Variables     -  
 php variables in mail function     -  
 Print all server variables     -  

Topic Tags

PHP Variables