php define index to push to array code example Example: php append element to array array_push($cart, 13);