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
Is php still used?
Explain me difference between mysql_connect and mysql_pconnect?
Does facebook use php framework?
What is the main difference between require() and require_once()?
CWD is a type of shell variable. State Whether True or False?
What is whitespace in php?
What does it mean when it says the csrf token is invalid?
What is mvc php?
Write a statement to show the joining of multiple comparisons in php?
Explain php split() function.
How do you end php?
How do I escape data before storing it into the database?
How does one prevent the following warning ‘warning: cannot modify header information – headers already sent' and why does it occur in the first place?
What is PHP? Who is the father or inventor of PHP?
Write a program to display table of a number using php?