Regarding variable reference

From: Date: Tue, 15 Jun 2004 06:14:43 +0000
Subject: Regarding variable reference
Groups: php.general 
Request: Send a blank email to php-general+get-188298@lists.php.net to get a copy of this message
Hi, I have variables called Cookie1 to Cookie35. I would like to print the values of Cookie1 to Cookie35 using for loop. Could anybody correct the below code to print the variables. ============================== for($i=1;$i<34;$i++) { $x="Cookie".$i; if(isset($$x)) { echo "<p>$x:$$x</p>"; } } ============================== Thanks in advance Balaji Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately and destroy all copies of this message and any attachments.

« previous php.general (#188298) next »