Micro Niche Builder
Closed Thread
Results 1 to 6 of 6

Thread: Store array in the session

  1. #1

    Default Store array in the session

    Hello

    I want to store whole array in the session. Is it possible to store an array in the session? Please send me an example for it.

    Thanks


  2. #2

    Default

    U mean to store array in session means u want to store all values ranging username password n all in a array at run time in the current working session?
    I wish to change the world, but they don`t provide me the source. HACK - 'R'

    PHP 5 AJAX

  3. #3

    Default

    Yes we can store an array into session.

    suppose TEMP is an array.
    To put array into session: Session["array"]=TEMP;

    and to retrive the array in another page: ArrayList temp=(System.Collections.ArrayList)Session["array"];

    I hope this will help u.

  4. #4

    Default

    E.G.

    $a = array('a','b','c');

    $_SESSION['ab'] = $a;

    this session var is array.
    to access this session var, print_r this variable

    print_r($_SESSION['ab']);

  5. #5

    Default

    You can store array in the session as a normal variables. you can use $_SESSION['ar'] = arrayname

  6. #6

    Default

    store
    Code:
    $ar = array(1,2,3);
    $_SESSION['sesarr']=$ar;
    retrive
    Code:
    $a=$_SESSION['sesarr'];
    print_r($a);

Closed Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts