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

$a = 10;
$b = 20;

echo $a, $b;
echo "<br>";
swap($a, $b);
echo $a, $b;
function swap(&$a, &$b)
{
$temp = $a;
$a = $b;
$b = $temp;
}

Is This Answer Correct ?    80 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is php still used?

924


Tell me what is the actually used php version?

994


armstrong number by using php while number is given by the keyboard.?

2153


How to retrieve the original query string?

1043


Tell me what is needed to be able to use image function?

946


Tell me what is the use of mysql_real_escape_string() function?

964


How to connect to mysql from a php script?

1014


So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?

1000


Is php faster than javascript?

903


When sessions ends?

923


What is session in c#?

965


What is a session in php?

968


What are the advantages of stored procedures, triggers, indexes in php?

997


How to access a specific character in a string?

943


Explain me what is the goto statement useful for?

789