Contact: aviboots(AT)netvision.net.il
41,215 questions
53,717 answers
573 users
// Use isset() to determine if array key is null or not $arr = array(); if (isset($arr[0])) { $arr[0]++; } else { $arr[0] = 1; } var_dump($arr); /* run: array(1) { [0]=> int(1) } */
// Use isset() to determine if array key is null or not $arr = array(); for ($i = 0; $i < 3; $i++) { if (isset($arr[0])) { $arr[0]++; } else { $arr[0] = 1; } } var_dump($arr); /* run: array(1) { [0]=> int(3) } */