Difference Between varibales

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dheeraja
Forum Commoner
Posts: 36
Joined: Tue Nov 09, 2010 11:03 pm

Difference Between varibales

Post by dheeraja »

Hi Guys,

I found in a page that variables are declared in two ways:
$_start = 1;
$result = 2;

Is there is any difference between both variable declaration, why underscore ( _ ) has used in first variable.

Thank you.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Difference Between varibales

Post by Jonah Bron »

No, there's nothing special about an underscore in a variable name. Here's the manual on the basics of variables:

http://php.net/variables.basics
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Difference Between varibales

Post by McInfo »

By convention, an underscore often implies that a variable is for private use.
Post Reply