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

function swap(){

$a = 10;
$b = 20;

$a = $a + $b;
$b = $a - $b;
$a = $a - $b;
echo $a, $b;

}

Is This Answer Correct ?    45 Yes 25 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which are the best start and end tags to use?

995


Why ide is recommended for use while programming with php?

924


How do I run a php program in dreamweaver?

1064


What is the meaning of symbol '$' in jquery?

1053


Is php a strongly typed language?

1005


How do I get csrf token?

964


What is overloading and overriding in php?

1159


What is $_ files in php?

1104


In php, objects are they passed by value or by reference?

963


Does php support multithreading?

1048


What is php session_start() and session_destroy() function?

1045


How to find the index of an element in an array php?

1001


what is mean by portal

2030


Difference between $message vs. $$Message in php.

991


What is a php trait?

938