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 sticky form in php?
Can we use include ("xyz.php") two times in a php page "index.php"?
Is python better than php?
What should we do to be able to export data into an excel file?
Write a program in php to find the occurrence of a word in a string?
Tell me what is the difference between unset() and unlink()?
What is the goto statement useful for?
What's php?
What is string and its function?
How do you check if a variable has been set in php?
What is delimiter php?
Why delimiter is used in mysql?
What is form validation in php?
which will print out the php call stack?
What is the difference between for and foreach loop in php?