Re: what does $$ mean?

From: Date: Tue, 06 Mar 2001 01:12:09 +0000
Subject: Re: what does $$ mean?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-42696@lists.php.net to get a copy of this message
An example of $$variables: <?php $smelly = "ditto"; $ditto = "wimpymeat"; $wimpymeat = "smelly"; $foo = "smelly"; for ($i=1;$i<6;$i++) { $foo = $$foo; echo $$foo . "\n"; } ?> Returns: wimpymeat smelly ditto wimpymeat smelly Now, why anyone would want to write a script that returns words like "wimpymeat" is beyond me. Sig for a Day Stephan Ahonen, ICQ 491101 "That's very funny Scotty, now beam down my clothes!" Come back tomorrow for a different sig! Backspace a single "s" to reply by email

« previous php.general (#42696) next »