note 73828 deleted from function.define by tularis

From: Date: Sun, 03 Jun 2007 09:36:49 +0000
Subject: note 73828 deleted from function.define by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-127139@lists.php.net to get a copy of this message
Note Submitter: user=fred68c, domain=free.fr ---- Hello Alf In this example, <?php $str = "test"; print $foo[$str]; ?> $foo[$str] will be translate to $foo[“test”] because $str is a string and output is then “debug 2” If you want the constant test your code should be : <?php $str = "test"; print $foo[constant($str)]; ?> or <?php $str = test; print $foo[$str]; ?> this output is now “debug 1”

« previous php.notes (#127139) next »