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

Explain the difference between urlencode and urldecode?

993


How can we submit a form without using submit buttons?

915


Can we use onclick in submit button?

966


What is the difference between client-side and server-side programming?

1004


Explain how can we execute a php script using command line?

971


What is use of header() function in php?

977


How many escape sequences are recognized in double-quoted strings?

951


What is mysqli_real_escape_string?

947


What are the difference between array_keys() and array_key_exists() in php?

1009


When do sessions end?

896


How can a cross-site scripting attack be prevented by php?

930


Is php closing tag necessary?

938


How to get a total number of elements used in the array?

932


What is active record in php?

843


How to access a Static Member of a Class in PHP?

963