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
Explain how you can update memcached when you make changes to php?
Tell me how do I check if a given variable is empty?
What is session php?
What does the php error 'parse error in php - unexpected t_variable at line x' means?
Which variable declarations within a class is invalid in php?
Could we start a variable with number like $4name?
What are the string function in php?
What would occur if a fatal error was thrown in your php program?
How can we display information of a variable and readable by a human with php?
What are the popular frameworks in php?
What is a string in r?
Name some of the functions in php.
Why do we use session?
Suppose your zend engine supports the mode Then how can you configure your php zend engine to support Mode ?
How is php different from other languages?