I have 10 elements of Array, how can i remove 5 array
element, with single function.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / dhir
<?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';
for($b=0;$b<=4;$b++)
{
$a=shift($a[$b]);
}
?>
| Is This Answer Correct ? | 1 Yes | 3 No |
How can we check the value of a given variable is alphanumeric?
how much can a 1yr experienced php programmer earn in india?
9 Answers TCS, Tops Technologies,
What does the unlink() function mean?
Tell me what are the functions to be used to get the image's properties (size, width and height)?
What can php do?
Explain the changes in php versions?
How long will it take to learn php?
What is the Diff. Between echo() and Print() in PHP?
29 Answers CoreNet, Priya, QueenZend, Sky InfoTech, Syntel,
Use of Session
What is the difference between rest and soap?
What is the importance of "action" attribute in a html form?
What is php stack?