Hi Ernest E Vogelsinger,

On Sat, 23 Nov 2002 17:07:50 +0100, you wrote about "Re: [PHP] echo'ing
array contents through reference variable ... why doesn't this work???"
something that looked like this:

>At 16:50 23.11.2002, -<[ Rene Brehmer ]>- said:
>>      echo($$pdag[$n]);
>>be able to pull the string contents of the array? Or is there some extra
>>needed when using referenced variable?
>This is ambiguous: is it "$$pdag" indexed by "[$n]", or is it "$pdag[$n]"
>dereferenced? If you're using an interim variable you'll get what you need
>- either use (depends on your data layout which I don't know)
>    $temp = $pdag[$n];
>    echo $$temp;
>    $temp = $$pdag;
>    echo $temp[$n];

Not sure about the correct terms in English, sorry ...

But to answer your question:
$pdag = "d".str_replace("-","",$premieredag[$i]);

where $premieredag is a date in form "2002-11-28".

So $n is then an index in the array that $pdag refers to.

But either way, writing echo(${$pdag}[$n]); got me the array contents as
desired ... so thank you. Now I can finally finish this thing ...


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to