Alright! Found the problem! Faulty script written that come before this
script where $$var come into play. At least, it wasn't me, it was the other
programmer's error. :-)
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Interesting! Look l
What docs at php.net? under variable, predefine variable or what?
"Andrey Hristov" <[EMAIL PROTECTED]> wrote in message
002601c22cd0$b1995170$1601a8c0@nik">news:002601c22cd0$b1995170$1601a8c0@nik...
> Variable variable. Read the docs.
>
> $v = 'foo';
> $foo = 'bar';
> echo $$v;
>
> Regards,
> An
I tried that test script you mentioned and it doesn't work in PHP 4.2.1. I
have a very good idea why is that, must have to do with the php.ini.
Unfortunately, it doesn't work either. I'll tell you what, I'll just throw
out that script and write a different script. This time, no double "$".
--c
variable variable... right up there with array array
basically what you are saying is resolve $var, then find out what that variable
holds
example;
assume your $counter is currently at 5
$var = "v".$counter."_high_indiv";
would mean that $var= "v5_high_indiv"
assuming that v5_high_ind
The cause for your problem would be that register_globals defaults to off in
PHP 4.2.x and greater.
The solution? Start using the new superglobals ($_POST, $_GET, $_SESSION
etc) or (not recomended) set register_globals = on in php.ini
Read more here:
http://www.php.net/manual/en/language.variable
Interesting! Look like the 2nd "$" is decomissioned and is reserve for
something in the future or something. Just like the "_" is when it come
with $_POST as an example. That would explain why it doesn't work with PHP
4.2.x & up.
"Andrey Hristov" <[EMAIL PROTECTED]> wrote in message
002601c22c
Variable variable. Read the docs.
$v = 'foo';
$foo = 'bar';
echo $$v;
Regards,
Andrey
P.S.
Sometimes {} are used : ${$v}
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> The script was working great before PHP 4.2.x and not after that. So, I
> looked thro
7 matches
Mail list logo