Try to initialize value at 3rd index.
$_SESSION['basket'][3] = 0;
Or the better solution is
$_SESSION['basket'][3] = isset($_SESSION['basket'][3]) ? $_SESSION['basket'][3] : 0;
Instead of only
$_SESSION['basket'][3];
More Related Contents:
- Perform logic operations on boolean array values
- Combine PHP array as something [duplicate]
- json_decode to array
- in_array() and multidimensional array
- Strange behavior Of foreach
- How to find entry by object property from an array of objects?
- Sum values of multidimensional array by key without loop
- HTML input arrays
- Combine two arrays
- How create an array from the output of an array printed with print_r?
- PHP array combinations
- How to create a HTML Table from a PHP array?
- Read each line of txt file to new array element
- Can you store a function in a PHP array?
- Sort array of objects by one property
- PHP Array Merge two Arrays on same key
- mysql_fetch_array, mysql_fetch_assoc, mysql_fetch_object
- Implode a column of values from a two dimensional array [duplicate]
- Checking if all the array items are empty PHP
- PHP case-insensitive in_array function
- How to delete object from array inside foreach loop?
- mysql select query within a serialized array
- Dynamic array keys
- Convert a String into an Array of Characters
- How do i count same values in an array and store it to a variable?
- Remove duplicate items from an array [duplicate]
- Chunk and transpose a flat array into rows with a specific number of columns
- What is the max key size for an array in PHP?
- Split array into a specific number of chunks
- Split a string with two delimiters into two arrays (explode twice)