basical string

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
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

basical string

Post by hrubos »

Would I ask a basical question ?
When I set a parametr, I have type $id_number --> is it good ? or without "_ " in string
User avatar
GeertDD
Forum Contributor
Posts: 274
Joined: Sun Oct 22, 2006 1:47 am
Location: Belgium

Post by GeertDD »

Variables names in php are allowed to contain underscores. I guess it is a matter of personal preference. I tend to use underscores as well.

To give you an idea, the combinations below are all possible.

Code: Select all

$id_number = 1;
$idnumber = 1;
$idNumber = 1;
hrubos
Forum Contributor
Posts: 172
Joined: Sat Oct 07, 2006 3:44 pm

Post by hrubos »

GeertDD wrote:Variables names in php are allowed to contain underscores. I guess it is a matter of personal preference. I tend to use underscores as well.

To give you an idea, the combinations below are all possible.

Code: Select all

$id_number = 1;
$idnumber = 1;
$idNumber = 1;
aha, so $id_number is possible.

But infuture I will use $idNumber, it's better

thanks much
User avatar
GeertDD
Forum Contributor
Posts: 274
Joined: Sun Oct 22, 2006 1:47 am
Location: Belgium

Post by GeertDD »

That's called camelBack style -- for obvious reasons. :wink:

http://www.fresnochaffeezoo.com/images/camel.gif

feyd | 75K gif..............
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

hrubos wrote:aha, so $id_number is possible.
Did you try this first? Trying this would have easily told you that it would work.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Everah wrote:
hrubos wrote:aha, so $id_number is possible.
Did you try this first? Trying this would have easily told you that it would work.
hehe - you should mention that in your signature or something... people just don't seem to get it! :twisted:
Post Reply