RE: [PHP] Any difference between these 2 forms of syntax?

From: Date: Sat, 11 May 2002 17:30:00 +0000
Subject: RE: [PHP] Any difference between these 2 forms of syntax?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-97120@lists.php.net to get a copy of this message
> 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...

« previous php.general (#97120) next »