php session array
session_start();
$_SESSION['name_here'] = $your_array;
php session array
session_start();
$_SESSION['name_here'] = $your_array;
session array
<?php
//Start your session.
session_start();
//Add a product ID to our cart session variable.
$_SESSION['cart'][] = 2787376;
//Dump it out for example purposes.
var_dump($_SESSION);
//how to access it
<?php
//Start your session.
session_start();
//Make sure that the session variable actually exists!
if(isset($_SESSION['cart'])){
//Loop through it like any other array.
foreach($_SESSION['cart'] as $productId){
//Print out the product ID.
echo $productId, '<br>';
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us