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 / ranjan
function swap(){
$a = 10;
$b = 20;
$a = $a + $b;
$b = $a - $b;
$a = $a - $b;
echo $a, $b;
}
| Is This Answer Correct ? | 45 Yes | 25 No |
Post New Answer View All Answers
Which php framework is best for security?
Which cryptographic extension provide generation and verification of digital signatures?
Explain what is the difference between for and foreach?
What is the difference between get and post in php?
Can we use php variable in javascript?
Explain about a search-friendly site looks like?
What is null value in php?
What does the scope of variables mean?
What is memcache?
Is a number php?
Which will check if a function exists?
How to send email using php script?
How many types of errors in php?
What is the purpose of the '.myi' file extension? What do thes file contain?
How to make a class in php?