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
Tell me will a comparison of an integer 12 and a string "13" work in php?
What is csrf cookie?
What does sign mean php?
What is move_uploaded_file in php?
Tell me what are sql injections, how do you prevent them and what are the best practices?
Explain the difference between urlencode and urldecode?
Is php 5.6 secure?
How long is a php session valid?
How to get the IP address of the client/user in PHP?
Should I learn php before wordpress?
What is the use of limit in mysql?
Why do we use namespace in php?
What is the difference between unset and unlink?
How to run the interactive php shell from the command line interface?
Tell me what is the use of the function htmlentities?