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

What is the purpose of constant() function?

1034


Can you use php and javascript together?

973


Do you have to initialize variables in php?

897


Does strlen include null?

1016


How is it possible to parse a configuration file?

905


What is the difference between substr() and strstr()?

1334


What is magic quotes?

956


Explain me is multiple inheritance supported in php?

1011


How does html form submit work?

861


How would you open a directory for reading in php?

956


Explain what does $_server means?

1005


Explain me the difference between include and require?

859


what is the current salary package in India for a PHP programmer who has 1.5 years experience

2922


What is the sign to start variables in PHP?

1018


How do you find the length of a string in php?

919