assign array values to variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Seems it should be simple, but how does one extract values from an array
and assign them to a variable?
foreach ($categoriesIN as $category) {
    echo "$category<br>";
    }
or
if(!empty($_POST['categoriesIN'])){
foreach( $_POST['categoriesIN'] as $key => $value) {
    echo "value = $value<br>";
        }
both show the values entered in the form but do not create a variable.
Since the number of entries will vary, I cannot assign a number of
variable names before knowing how many entries there may be.

-- 
unheralded genius: "A clean desk is the sign of a dull mind. "
-------------------------------------------------------------
Phil Jourdan --- pj@xxxxxxxxxxxxx
   http://www.ptahhotep.com
   http://www.chiccantine.com/andypantry.php


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux