How to delete all elements from array strat from specific index in PHP

1 Answer

0 votes
$arr = array("php", "c", "c++", "c#", "python", "java");

array_splice($arr, 3);

print_r($arr);




/*
run:

Array
(
    [0] => php
    [1] => c
    [2] => c++
)

*/

 



answered Dec 8, 2020 by avibootz
...