I have 10 elements of Array, how can i remove 5 array
element, with single function.

Answer Posted / vipul dalwala

Hi Yukti,

You can also use array_slice but array_splice is also not
the wronng one.

array_splice function can take four arguments if you omit
the fourth argument which is for replacement array this
function will serve the same purpose as array_slice.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does csrf token change?

609


What is a null coalescing operator in php7?

802


Tell me what does pear stands for?

658


Does php have multiple inheritance?

615


Why do we use htaccess

711






Is laravel better than codeigniter?

650


What are the special characters you need to escape in double-quoted stings?

663


Can I write php code in html file?

620


Which are the best start and end tags to use?

677


What are the different types of PHP arrays?

660


Is facebook still in php?

593


Write a query to find the 2nd highest salary of an employee from the employee table?

739


What is the difference between query and question?

600


How we can retrieve the data in the result set of mysql using php?

600


Which is used to maintain the value of a variable over different pages?

655