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
How to call javascript function in php without any event?
How to break a file path name into parts?
Why should I learn php?
if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer
What is a query give example?
What is php limit?
Is strcmp case sensitive?
What are the types of variables in php?
What is the use of callback in php?
How to convert strings to numbers in php?
What is php artisan tinker?
How to take a substring from a given string in php?
How can you retrieve a cookie value?
What is inheritance in php with example?
Is php fully object oriented?