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 |
where to change in php.ini file for file uploading?
How to check if a string contains a character or word in php?
What is the purpose of the following files having extensions: frm, myd, and myi? What these files contain?
What distinguishes php from something like client side java script?
What is php in simple words?
What is interface? Why it is used?
What are the benefits of using php and mysql?
Tell me how to retrieve a cookie value?
How can we calculate the similarity between two strings?
What is php and how do you use it?
How many escape sequences are recognized in double-quoted strings?
What is difference between required and require_once in php?