Sudarshan Taparia Sudarshan Taparia - 1 year ago 64
PHP Question

PHP :Initializing elements of session array

I have created a session array as


I wish to initialize first 5 elements of this to 0.How it can be done?

Answer Source

As every on suggested above, try this:-


$_SESSION['yans'] = array('A','B','C','D','E');
echo "<pre/>";print_r($_SESSION);die;



Note:- it's a simple example given for your understanding. thanks.