vendredi 21 juillet 2017

how to declare multiple session variables according to the length of array(php)

enter code here
session_start();
$imgList = $_REQUEST['imgList'];//comes through post (jquery)
$i=0;
$a=explode(',',$imgList); 
$abc=count($a);
for ($e=0;$e<$abc;$e++)
{
echo $_SESSION['c+$i']=$a[$e];
$i++;
}
echo $_SESSION['c+$i'];//this returns the last value
echo count($_SESSION['c+$i']);//returns only length 1
echo count($i);// returns only length 1

i dont know why more than one variable are not initilizing. can anyone please tell me about htis problem or fix this.i"ll be very thankful to you for this favor




Aucun commentaire:

Enregistrer un commentaire