Contact: aviboots(AT)netvision.net.il
41,427 questions
53,974 answers
573 users
$array = [1, 2, 3, 4, 5, 6]; // Use array_slice to skip the first element $modifiedArray = array_slice($array, 1); // Iterate over the modified array foreach ($modifiedArray as $value) { echo $value . "\n"; } /* run: 2 3 4 5 6 */
$array = ['a' => "PHP", 'b' => "Java", 'c' => "Python", 'd' => "C#", 'e' => 'C']; // Use array_slice to skip the first element $modifiedArray = array_slice($array, 1); // Iterate over the modified array foreach($modifiedArray as $key => $value) { echo "$key - $value\n"; } /* run: b - Java c - Python d - C# e - C */