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

Answer Posted / vaneet badhan

$a=array(2,4,1,3,22,15);

for($v=0;$v<=4;$v++)
{
unset($a[$v]);
}

This code will remove elements "2,4,1,3,22" from array $a
and the output will be : "15"

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the interface in php?

606


Explain about getters and setters in php?

589


How stop the execution of a php scrip?

585


Hello Friends,I am seeking for a job in php having 9 months. exp.Please suggest any company openings.

1778


What is csrf token and how will you add csrf token in ajax?

577






How to get best php developer Experience in Php with Sugar CRM / VTiger.

4020


I need to know about the courses which are useful in corporate companies.. especially php/mySQL, Java/j2ee, .NET.. also tell if any other courses are valuable

1571


When to use self over $this?

620


Tell me what is the use of "ksort" in php?

605


What is a php 5?

609


How do we get the current session id?

617


What is namespaces in PHP?

609


What are php functions?

619


What are examples of independent and dependent variables?

547


How to create a directory?

667