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
i m a B.E,passed out few yrs bak failed to find good job due to less marks now thinkin of a career as PHP developer. is it a lucarative field and wat r career prospects; hv heard dat initial salary is very less bout 6k also most jobs r contrct jobs.pls guide me need ur valuable advice.pls hellppp!! thnx..
Why use php artisan serve?
What is super keyword in c++?
Explain include(), include_once, require() and require_once?
Which function is used to read a file removing the html and php tags in it upwork?
What is string and its function?
How can we change the value of a constant?
How is it possible to propagate a session id?
What is the actually used php version?
How do you sort an array in php?
How to read one character from a file?
What is trim codeigniter?
What is $$ in php?
What does $_ post mean in php?
Suppose your zend engine supports the mode Then how can you configure your php zend engine to support Mode ?