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

Explain how you can update memcached when you make changes to php?

1210


Tell me how do I check if a given variable is empty?

1014


What is session php?

1007


What does the php error 'parse error in php - unexpected t_variable at line x' means?

1140


Which variable declarations within a class is invalid in php?

1026


Could we start a variable with number like $4name?

974


What are the string function in php?

1029


What would occur if a fatal error was thrown in your php program?

1126


How can we display information of a variable and readable by a human with php?

1008


What are the popular frameworks in php?

1021


What is a string in r?

980


Name some of the functions in php.

1087


Why do we use session?

1058


Suppose your zend engine supports the mode Then how can you configure your php zend engine to support Mode ?

1047


How is php different from other languages?

941