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 / meenakshisundaram
$a = 10;
$b = 20;
echo $a, $b;
swap();
echo $a, $b;
swap(){
list($a, $b) = array($b, $a);
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is php date function?
Tell me how the result set of mysql be handled in php?
What is use of htmlspecialchars php?
How to write comment in php?
What are properties in php?
What is an example of a variable?
Differentiate echo vs. Print statement.
Tell me how can we determine whether a php variable is an instantiated object of a certain class?
How to convert a string to uppercase in php?
What is the difference between array_merge() and array_merge_recursive() in php?
What does the arrow mean in php?
How can you execute php script from the command line?
How can we connect to a mysql database from a php script?
Explain the types of string comparision function in PHP
Explain the importance of the function htmlentities.