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 |
What is an example of a variable?
Which function you can use in php to open a file for reading or writing or for both?
Differences between get and post methods?
Explain the advantages of using PHP?
How to read a file in php?
Write a program to find the factorial of a number in php?
What is a base url?
What is the difference between array_map () and array_shift ()?
What is empty php?
What are the encryption functions available in PHP?
"mysql_fetch_row — Get a result row as an enumerated array",this sentence comes from the PHP offical manual.However ,i can not understand the words "enumerated array".I need some help.Thanks a lot to everyone that reply.
Differences between get, post and request methods ?