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.

Answer Posted / vaneet badhan

$a=array(2,4,1,3,22,15);

for($v=0;$v<=4;$v++)
{
unset($a[$v]);
}

This code will remove elements "2,4,1,3,22" from array $a
and the output will be : "15"

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me will a comparison of an integer 12 and a string "13" work in php?

1024


What is csrf cookie?

859


What does sign mean php?

921


What is move_uploaded_file in php?

919


Tell me what are sql injections, how do you prevent them and what are the best practices?

863


Explain the difference between urlencode and urldecode?

993


Is php 5.6 secure?

920


How long is a php session valid?

963


How to get the IP address of the client/user in PHP?

909


Should I learn php before wordpress?

923


What is the use of limit in mysql?

915


Why do we use namespace in php?

877


What is the difference between unset and unlink?

920


How to run the interactive php shell from the command line interface?

1036


Tell me what is the use of the function htmlentities?

896