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 / dinesh kumar

function swap($x,$y)
{
$x^=$y^=$x^=$y;
return array($x,$y);
}
list($a,$b)=swap(5,10);
echo $a;
echo $b;

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to pass variables and data from php to javascript?

1099


Is php free to use?

1052


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

979


What does pear stand for?

1015


What are the encryption functions in php?

1223


What is use of header() function in php?

1076


Php error constants and their descriptions

1260


What are PHP Magic Methods/Functions. List them.

1119


Explain me how to include a file to a php page?

1033


How To Get the Uploaded File Information in the Receiving Script?

1076


How is csrf token generated?

1044


What is lazy loading in php?

1006


Do you know what is the differences between $a != $B and $a !== $B?

1058


How to receive a cookie from the browser?

1203


hello all, I need some sample placement papers in lion bridge.. can anyone help me?

2124