Re: Re: Variable name as a string

From: Date: Wed, 27 Aug 2008 21:41:36 +0000
Subject: Re: Re: Variable name as a string
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-278839@lists.php.net to get a copy of this message
At 1:58 PM -0500 8/27/08, Shawn McKenzie wrote:
ioannes wrote:
Actually, you are right, as you just put the checkbox index in the POST and get the value from there. So you just need the number of checkboxes...sorry. for ($i = 1; $i <= 4; $i++) { $a = 'a' . $i; $b = 'whatever' . $i; if($_POST[$a] == 'on')
      {
       my_array[] = $_POST[$b]
      }
} " John
Either I'm missing what you're trying to do, or this has become incredibly over complicated! -Shawn
It's not over complicated, but just a method of passing checked checkbox values to a php array. Do you have something better? Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#278839) next »