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
When to use get and post request?
When do sessions end?
Can php run without server?
How would you determine the size of a file in php?
What is php and what does it do?
What is the importance of parser in php?
Are there regular expressions in php?
Can constructor be private in php?
How can I increase my website session?
Tell me what is the main difference between php 4 and php 5?
Which is better wamp or xampp?
What is new static in php?
Explain about PHP filter and why it should be used?
List some sorting functions in php?
What is the current stable version of php? What advance thing in php7?