php session variable
- by Idealflip
Hi Everyone, my session variable seems to keep dropping its array values. What could I be doing wrong? Is it my object?
if(isset($_SESSION['locations'])){
$_SESSION['locations']->listItems($_POST['companyLocation']);
echo "session exists";
}else{
$_SESSION['locations'] = new Location();
$_SESSION['locations']->listItems($_POST['companyLocation']);
echo "session does not exist";
}
class Location {
function listItems($location){
$array;
$array[] = $location;
print_r($array);
}