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
Is php fully object oriented?
How can you pass a variable by reference?
What is the basic function to search files for lines (or other units of text) that contain a pattern.
What is csrf token and how will you add csrf token in ajax?
How to track no of user logged in?
Write a statement to show the joining of multiple comparisons in php?
What is whitespace in html?
How to get ip address of clients machine?
Which function is used in php to check the data type of any variable?
Why we use get in php?
What is use of count() function in php?
How the values are ordered in an array?
What are the steps involved to run php?
What language is similar to php?
Can php run without apache?