Re: array data

From: Date: Wed, 11 Feb 2004 14:29:53 +0000
Subject: Re: array data
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-177385@lists.php.net to get a copy of this message
Think this is what u want Imran Asghar wrote:
Hi, Is not working, is it correct way???? File1.php
       <? $colors = array('red','blue','green','yellow'); ?>
       <form action="file2.php" method="post">
      <input type="hidden" type" name="colors" value="<?=$colors?>">
      </fomr>
<?php $colors = array('red','blue','green','yellow'); ?> <form action="file2.php" method="post"> <?php foreach $colors as $k => $v { ?> <input type="hidden" type" name="colors[<?php echo $k; ?>]" value="<?php echo $v; ?>"> <?php } ?> </form>
File2.php <? echo $colors[0]; echo $colors[1]; echo $colors[2]; echo $colors[4]; ?> <?php
echo $_POST['colors'][0]; etc .... ?>
imee


« previous php.general (#177385) next »