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...

1. Write a function to swap two values ?
$a = 10;
$b = 20;
echo $a, $b;
swap(); // If u want u can pass parameters
echo $a, $b; // It should print 20 , 10

Answer Posted / meenakshisundaram

$a = 10;
$b = 20;
echo $a, $b;
swap();
echo $a, $b;

swap(){
list($a, $b) = array($b, $a);
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How long is session timeout?

1051


Does wordpress still use php?

1055


What is the function mysql_pconnect() usefull for?

1184


Is it possible to remove the html tags from data?

967


What's the best method for sanitizing user input with php?

979


How to assigning a new character in a string using php?

1283


Explain what is the difference between for and foreach?

1124


What is the difference between echo print and print_r in php?

1080


Does browser understand php?

989


Tell me how to create a text file in php?

1040


What is overloading in php?

1044


How to list all values of submitted fields?

989


Do you know what is the function mysql_pconnect() usefull for?

1003


Explain about getters and setters in php?

1136


What is the purpose of the '.myd' file extension? What do thes file contain?

1036