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 age interval or ordinal?
What is mysqli_query?
What is factory pattern in php?
Does wordpress run on php 7?
How to reset/destroy a cookie?
Are objects passed by value or by reference?
What are arguments in php?
Why do we use php?
What does the function get_magic_quotes_gpc() means?
What beforeFilter() is used?
What is php dependency injection?
Is runtime polymorphism overriding?
How to open standard output as a file handle?
Tell us how can we display the output directly to the browser?
Write a program to show the joining of two strings in php?