$fruits = array("apple", "banana", "orange", "grape", "peach"); // Remove two elements starting from index 2 array_splice($fruits, 2, 2); print_r($fruits); // Replace two elements starting from index 1 with "cherry" array_splice($fruits, 1, 2, "cherry"); print_r($fruits);