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

How to find the length of a string?

933


What is data structure in php?

978


What is an array in php?

1087


Write a program to find no of days between two dates in php?

961


Which function can be used to exit from the script after displaying the error message?

914


What are the benefits of using php and mysql?

957


What is the function file_get_contents() usefull for?

945


How to run the interactive php shell from the command line interface?

1067


Which is useful for method overloading?

1102


How to get ip address of a server in php?

994


How to convert strings in hex format?

980


Is age interval or ordinal data?

944


What is the current php version?

1049


What is in a cookie?

924


Tell me how can we connect to a mysql database from a php script?

930