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 do you check if an arraylist is empty?
What is different types of visibility?
What is the sign to start variables in PHP?
Is null function in php?
Does jwt protect against csrf?
Explain php split() function.
What is php explain how php works?
How do you develop your own PHP extension ?
what are the basic steps to installation php4+mysql4+phpmyadmin on IIS web server?. Pls write the complete steps.
Which function you can use in php to open a file for reading or writing or for both?
What are the popular frameworks in php?
What is polymorphism with example in php?