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

Explain about PHP filter and why it should be used?

948


What is design pattern? Explain all including singleton pattern?

977


How to find the length of a string?

966


Tell me what does the initials of php stand for?

966


What is the value for this auto incremented field user_pri_id?

931


What is the use of explode() function?

1064


What is the difference between characters 23 and x23?

1001


How to get the number of characters in a string?

1029


Which is the best php framework for a beginner?

1005


How to delete an element from an array?

1088


What does the unlink() function means?

1094


What is the best way to test the strpos() return value in php?

981


What is the purpose of pear in php?

1021


Explain me what is the importance of "method" attribute in a html form?

928


Is php an object or array?

959