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

The above answer is correct. But the interviewer does not
want to echo the values from inside the function. It should
be in the following way
$a = 10;
$b = 20;
echo $a, $b;
swap(); // Here if you want you can pass the variables
echo $a, $b;

function swap()
{
}

Is This Answer Correct ?    8 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When to use get and post request?

1003


When do sessions end?

938


Can php run without server?

1035


How would you determine the size of a file in php?

1043


What is php and what does it do?

1051


What is the importance of parser in php?

1200


Are there regular expressions in php?

934


Can constructor be private in php?

1025


How can I increase my website session?

1052


Tell me what is the main difference between php 4 and php 5?

988


Which is better wamp or xampp?

965


What is new static in php?

985


Explain about PHP filter and why it should be used?

943


List some sorting functions in php?

951


What is the current stable version of php? What advance thing in php7?

1011