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 submit a form without a submit button?
2 Answers Rushmore Consultancy,
Write a program to get second highest number in an array using php?
What is the difference between $argv and $argc? Give example?
What are php parameters?
What is the difference between indexed and associative array?
Is nan in php?
Does php need a closing tag?
Which function is used in php to count the total number of rows returned by any query?
Write a php code which could be used to generate random numbers between 1 - 100 and display them on the screen.
What is a helper function?
In how many ways we can retrieve the date in the result set of mysql using PHP?
Describe the differences between the object models in PHP 4 and PHP 5.