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 / sangita jain

<?php function swap(){
$a=10;
$b=20;
$b=$b-$a;
$a=$a+$b;
echo $a,$b;
}

swap();

?>

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How long will it take to learn php?

1028


What is the difference between core php and php?

988


What is the use of dual table in mysql?

1013


What is the use of the function 'imagetypes()'?

1073


What are constructor and destructor in PHP?

1180


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

1045


What is the definition of a session?

1024


What is the php function that removes the last element of the array and returns it?

1009


How to convert a string to lowercase in php?

1095


What is cookie in php with example?

1003


Can you convert php to html?

1023


What is different types of visibility?

977


Who created numbers?

1029


what is the scope of php in the future if any other language is developed then may be php is loss ???

14613


Difference between array_combine and array_merge?

1257