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

What are some new features introduced in php7?

8368


How to stop the execution of php script?

518


Tell me how a constant is defined in a php script?

472


What is the importance of "action" attribute in a html form?

532


What is escaping to php?

530






Tell me what is the main difference between php 4 and php 5?

527


What is move_uploaded_file in php?

538


What is difference between required and require_once in php?

536


what is difference between PHP4 , PHP5

1894


Binary tree question - Node has numeric data (int) The function takes depth as argument and sum all the value of the node of the depth. For instance, (0) depth 0 / \ 10 20 depth 1 / \ / \ 40 50 60 70 depth 2 so if you pass get_sum(2), you would return 220 which is 40+50+60+70 (sum of depth2) write the function.

1501


Php code to find whether a number armstrong or not?

537


How cookies are transported from servers to browsers?

510


What is preg_match?

538


What advance thing in php7?

514


What is php and what does it do?

537