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

Answer Posted / phani

$output = array_splice($input, 0, 5));

print_r($output);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to move uploaded files to permanent directory?

536


What is http get and post?

535


I am writing an application in php that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with php?

516


What are sql functions?

540


What is mysqli php?

526






What kind of variable is age?

607


Which is faster for or foreach?

514


Explain about PHP cookies?

622


How to redirect a url from http to https in .htaccess?

523


What is uniqid php?

578


What is the difference between for and foreach loop in php?

626


what is mean by portal

1466


Tell me how is it possible to remove escape characters from a string?

494


How to find the length of a string?

553


Explain type casting and type juggling.

562