Re: accessing values from an array
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: accessing values from an array

From: ZeldorBlat <zeldorblat@gmail.com>
Date: Fri Nov 18 2005 - 04:02:09 CET

>on page2.php, i can't figure out how to access the array. i want to
>print each element of the array on a seperate line. w/o all the other
>it would look something like:
>
>echo "$info[1]<br>";
>echo "$info[2]<br>";

Shouldn't it be:

echo $_SESSION['info'][0] . "<br/>";
echo $_SESSION['info'][1] . "<br/>";

Or, if you want a foreach loop:

foreach($_SESSION['info'] as $val)
   echo $val . " was checked<br/>";
Received on Mon Nov 21 03:04:49 2005