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

<?php
$a = 10;
$b = 20;
echo $a, $b;
$a=$a+$b;
$b=$a-$b;
$a=$a-$b;
echo "<br>";
echo $a, $b;

?>

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sticky form in php?

842


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

971


Is python better than php?

951


What should we do to be able to export data into an excel file?

964


Write a program in php to find the occurrence of a word in a string?

1035


Tell me what is the difference between unset() and unlink()?

997


What is the goto statement useful for?

954


What's php?

1009


What is string and its function?

921


How do you check if a variable has been set in php?

916


What is delimiter php?

939


Why delimiter is used in mysql?

1012


What is form validation in php?

967


which will print out the php call stack?

924


What is the difference between for and foreach loop in php?

1036