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
How long is session timeout?
Does wordpress still use php?
What is the function mysql_pconnect() usefull for?
Is it possible to remove the html tags from data?
What's the best method for sanitizing user input with php?
How to assigning a new character in a string using php?
Explain what is the difference between for and foreach?
What is the difference between echo print and print_r in php?
Does browser understand php?
Tell me how to create a text file in php?
What is overloading in php?
How to list all values of submitted fields?
Do you know what is the function mysql_pconnect() usefull for?
Explain about getters and setters in php?
What is the purpose of the '.myd' file extension? What do thes file contain?