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 / sunil kumar
<?php
$a = 10;
$b = 20;
echo $a, $b;
$a=$a+$b;
$b=$a-$b;
$a=$a-$b;
echo "<br>";
echo $a, $b;
?>
| Is This Answer Correct ? | 9 Yes | 2 No |
Post New Answer View All Answers
what is mean by portal
Where php basically used?
How does php server work?
Write syntax to open a file in php?
Why triggers are used in mysql?
What is slim framework?
How do I install php and apache on windows 10?
What is php regular expression?
What is chrome logger?
Does php need apache?
Is php coding easy?
Is age a variable in research?
Which variable declarations within a class is invalid in php?
How do you end a function in python?
What does type casting mean in php? Explain with an example?