I have 10 elements of Array, how can i remove 5 array
element, with single function.
Answer Posted / shaik abdul raheem
<?php
$a[0]='a';
$a[1]='b';
$a[2]='c';
$a[3]='d';
$a[4]='f';
$a[5]='g';
$a[6]='h';
$a[7]='i';
unset($a[4]);
for($b=0;$b<=count($a);$b++)
{
echo $a[$b]."<br>";
}
?>
| Is This Answer Correct ? | 4 Yes | 5 No |
Post New Answer View All Answers
Is php case sensitive?
How will you calculate days between two dates in PHP?
Tell me what is the difference between ereg_replace() and eregi_replace()?
What is preg_match?
What are arguments in php?
What the difference between the 'bitwise and' operator and the 'logical and' operator?
What is singleton pattern in php?
Tell me what are magic methods?
Is php worth learning in 2019?
What are the rules to determine the “truth” of any value which is not already of the boolean type?
Explain how is it possible to cast types in php?
How to protect special characters in query string?
What are the different filter functions used to filter a variable?
Can php run without apache?
Why php is sometimes called as embedded scripting language?