Ajax Tutorials, PHP Tutorial, Javascripts, Visual Basic.Net Training, XHTML tutorial, php script library, PHP Codes, Web Design tutorials, web development tutorials
Ajax Tutorials, Programming Tutorials, PHP Script Index
Home | Forums | Downloads | Books | Submit Content | Links
Articles Categories
  PHP articles
  MySql articles
  Visual Basic.Net articles
  Java articles
  ASP articles
  ASP.Net articles
  Visual Basic articles
  CSS articles

Tutorials Categories
  PHP tutorials
  MySql tutorials
  Visual Basic.Net tutorials
  Java tutorials
  ASP tutorials
  ASP.Net tutorials
  Visual Basic tutorials
  HTML tutorials
  CSS tutorials

Source Codes
  PHP scripts
  Visual Basic.Net scripts
  JavaScript scripts
  ASP scripts
  ASP.Net scripts
  Visual Basic scripts

Our Partners

  Free Resources
  Publisherbank
  Free Link Directory
  PHP Magazine
  Webmaster Passion
  Search Engine Bank
  Free Directory Site
  Free PHP Scripts
  Links Shopping Mart
  Variety Bazar
  Urdu Office Learning
  Evernew Scripts
  Evernew Scripts
  Evernew Directory
  Our Achievements
  Web templates
  Buy and Sell Templates
  Text Link Traders
  Directory Metro
  Gifts Choice
  Valentines Ecards
  Template Directory

Variables in PHP

Date:2006-02-13

The purpose of variable to store information or any value. A variable is symbolic name that represents some data that you set. For example, age is a variable and different persons have different age. PHP is case sensitive, that means that myvars and myvars1 are two different names to PHP because they have different capitalization. PHP accepts unique variable names. Variables have much type of values (like numeric, string and logical values), in PHP every variable should be declare with $ symbol .

Variable Name Guidelines

  • Must start with alphabetical character
  • Variable names are case-sensitive
  • can't contain any periods or type-declaration characters
  • must be unique within the same scope
  • must be 255 characters or less
  • Variable must begin with a letter or the underscore character

How to use variables?

In php, variable starts with $ symbol. for example:
$age = 5;
$name = "Chris";

<?PHP
$name=”my name is mark”;
print $name;
?>

In this example we have defined two variable name, age, name has string value “mark” but age has numeric value 35, The output will display as below:

my name is mark

Another Example of PHP

<?php
$value1=35;
$value2=88;
$result=$value1+$value2;
print "Result is";
 print $result;
?>

Output

Result is 123



Desclaimer | Privacy Policy | Submit Content | Links | Link to Us | Sitemap |Contact Us
Copyright Programming Tutorials, Web Development Tutorials, Source codes © All Rights are Reserved.
Powered By Evernew Solutions

Credit Card Consolidation - Hotel Las Vegas - Share Dealing - Unsecured Loans