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 / naresh
$a=10;
$b=10;
list($a,$b) = array($b, $a);
echo "a=" . $a;
echo "b=" . $b;
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
Do you know design patterns. List few?
What is session expiry?
What is urlencode and urldecode in php?
What is the major php security hole? How to avoid?
What would occur if a fatal error was thrown in your php program?
How to turn on the session support in php?
How to use http headers inside php?
Why ide is recommended for use while programming with php?
What is php? Why it is used?
How to connect to a url in php?
How to pass variables and data from php to javascript?
How do you check if a variable has not been set in php?
Tell me how to strip whitespace (or other characters) from the beginning and end of a string?
armstrong number by using php while number is given by the keyboard.?
Explain the visibility of the property or method?