Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


I have 10 elements of Array, how can i remove 5 array
element, with single function.

Answers were Sorted based on User's Feedback



I have 10 elements of Array, how can i remove 5 array element, with single function...

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

I have 10 elements of Array, how can i remove 5 array element, with single function...

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

I have 10 elements of Array, how can i remove 5 array element, with single function...

Answer / guest

using "limit 1 5"

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More PHP Interview Questions

What are some new features introduced in php7?

0 Answers  


Write a program to get lcm of two numbers using php?

0 Answers  


Explain some most commonly use string functions in php?

0 Answers  


What is mvc? Why its been used?

0 Answers  


How can we access the data sent through the url with the post method?

0 Answers  


Describe PHP error and logging information?

0 Answers  


What is the use of friend function?

7 Answers   Wipro,


What are the different tables(engine) present in mysql, which one is default?

0 Answers  


What are the differences between require and include, include_once?

3 Answers  


Explain preg_Match and preg_replace?

0 Answers  


Which escape sequences can be used in single quoted strings in php?

0 Answers  


What does php do?

0 Answers  


Categories