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 many data types are there in php?

1140


What's the output of the ucwords function in this example?

1099


Is python better than php?

1056


Tell us how can we access the data sent through the url with the post method?

1028


Which will start a session?

1063


Is nan in javascript?

1024


Is null or empty c#?

962


What is the difference between get & post ?

1168


Can we use include ("xyz.php") two times in a php page "index.php"?

1068


What is a helper function?

995


What is the scope of a variable defined in a function?

1122


How to submit form without a submit button.

1124


Is php 5.6 secure?

1038


Why php is used in html?

994


How to know user has read the email-php?

997