Welcome Guest, Not a member yet? Register   Sign In
Updating a session array
#4

Pushing New Value to Session Data.

The push() method is used to push a new value onto a session value that is an array.
For instance, if the hobbies key contains an array of hobbies, you can add a new value
onto the array like so:

PHP Code:
<?php

$session
->push('hobbies', ['sport' => 'tennis']); 
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
Updating a session array - by Qodi - 10-19-2018, 12:35 PM
RE: Updating a session array - by Sunchock - 01-31-2025, 04:25 AM
RE: Updating a session array - by luckmoshy - 01-31-2025, 09:59 AM
RE: Updating a session array - by InsiteFX - 01-31-2025, 11:35 PM
RE: Updating a session array - by Sunchock - 02-01-2025, 06:29 AM
RE: Updating a session array - by ozornick - 02-04-2025, 12:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB