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 / naresh

$a=10;
$b=10;
list($a,$b) = array($b, $a);
echo "a=" . $a;
echo "b=" . $b;

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to call javascript function in php without any event?

950


How to break a file path name into parts?

972


Why should I learn php?

1054


if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer

1908


What is a query give example?

985


What is php limit?

1059


Is strcmp case sensitive?

959


What are the types of variables in php?

1065


What is the use of callback in php?

996


How to convert strings to numbers in php?

1120


What is php artisan tinker?

975


How to take a substring from a given string in php?

907


How can you retrieve a cookie value?

1069


What is inheritance in php with example?

1012


Is php fully object oriented?

919