session_start(); // start session $_SESSION['my_arr'] = array(); // initialize session array array_push($_SESSION['my_arr'], 'apple', 'banana', 'orange'); // add elements to session array print_r($_SESSION['my_arr']); // display session arrayIn this example, we start a session, initialize a session array 'my_arr', then use the array_push() function to add elements ('apple', 'banana', 'orange') to the array. Finally, we display the contents of the session array. Package Library: PHP Session push does not depend on any package library, it is a built-in function of PHP.