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

Is php fully object oriented?

984


How can you pass a variable by reference?

1054


What is the basic function to search files for lines (or other units of text) that contain a pattern.

1036


What is csrf token and how will you add csrf token in ajax?

1026


How to track no of user logged in?

1061


Write a statement to show the joining of multiple comparisons in php?

1062


What is whitespace in html?

1071


How to get ip address of clients machine?

1036


Which function is used in php to check the data type of any variable?

997


Why we use get in php?

1036


What is use of count() function in php?

1098


How the values are ordered in an array?

1156


What are the steps involved to run php?

1117


What language is similar to php?

1044


Can php run without apache?

1066