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
Explain the changes in php versions?
How to turn on the session support in php?
What is static in php?
What is polymorphism with example in php?
Tell me what are the encryption techniques in php?
Can we use get instead of post?
Explain me the difference between include and require?
What are the php variables?
What does $globals mean?
Name some of the constants in php and their purpose.
What is traits? How it is used in php?
What does echo mean in php?
What is $_ files in php?
What is compact function php?
Is laravel frontend or backend?