RE: [PHP] Any difference between these 2 forms of syntax?
> I am wondering if there is any tangible difference between the following > two > commands: > > $x = $foo["status"]; > $x = $foo['status']; The only difference to any strings enclosed in ' or " is that strings enclosed in " may have variables embedded within them. Strings enclosed with ' will not have variables evaluated within them. $name = "John"; Echo "My name is $name"; Echo 'My name is $name"; The first echo will output "John" as the name, the second one will output a literal "$name". ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any difference between these 2 forms of syntax?
Addressed to: "Richard Davey" <[EMAIL PROTECTED]> [EMAIL PROTECTED] ** Reply to note from "Richard Davey" <[EMAIL PROTECTED]> Sat, 11 May 2002 01:54:43 +0100 > > Hi, > > I am wondering if there is any tangible difference between the following two > commands: > > $x = $foo["status"]; > $x = $foo['status']; > $foo['status']; should be marginaly faster as PHP doesn't have to look for $ in the value that need to be converted to their values. Rick Rick Widmer Internet Marketing Specialists http://www.developersdesk.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Any difference between these 2 forms of syntax?
Hi, I am wondering if there is any tangible difference between the following two commands: $x = $foo["status"]; $x = $foo['status']; The part in question being the use of ' or " around the "status" element of the array $foo. Both have the same end result in my case, I'm just purely wondering which is the correct form of syntax to use? Cheers, Rich -- Fatal Design http://www.fatal-design.com Atari / DarkBASIC / Coding / Since 1995 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php