variables inside single quotes are not evaluated! This is the same variable:
echo $GLOBALS['var'];
$key='var'; echo $GLOBALS[$key];
With $GLOBALS['$key'] you refer to an invalid variable name $'$key'
PS: Output of
echo GLOBALS['$key'] = $valuebr\n;
is right because $key is in double quotes (the
there is no $ in front of GLOBALS ;)
Ernest E Vogelsinger wrote:
At 09:24 27.03.2003, Marek Kilimajer said:
[snip]
echo GLOBALS['$key'] = $valuebr\n;
is right because $key is in double quotes (the outermost qoutes)
Daevid Vincent wrote:
This one does NOT work the way I would expect it to?
function clearContactVars()
{
foreach ($GLOBALS as $key = $value) {
if ( substr($key,0,8) == contact_ ) {
//echo GLOBALS['$key'] =
3 matches
Mail list logo