Welcome Guest, Not a member yet? Register   Sign In
problem regarding session problem . i can`t store session value passing through jquery ajax.
#11

[eluser]Anchal Gupta[/eluser]
what i found that when i pass value to function through ajax jquery and without using MY_SESSION class
Ex i store some array in session like Array([21]=>42) . Now
for second pass this value get destroyed and get the new value
#12

[eluser]InsiteFX[/eluser]
Code:
<?php
// an array of attributes about a dog
$array = array('animal'=>'dog', 'name'=>'Offenbach', 'owner'=>'Mr Smith');

// add the dogs favourite food to the array
$array = array_push_assoc($array, 'food', 'postmans leg');

// print the array
print_r($array);

/**
* @Push and element onto the end of an array with associative key
*
* @param array $array
* @string $key
* @mixed $value
* @return array
*/
function array_push_assoc($array, $key, $value)
{
    $array[$key] = $value;
    return $array;
}

?>

This will return the following results

Array
(
   [animal] => dog
   [name] => Offenbach
   [owner] => Mr Smith
   [food] => postmans leg
)




Theme © iAndrew 2016 - Forum software by © MyBB