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
Explain do you use composer? If yes, what benefits have you found in it?
What are the three classes of errors that can occur in php?
What is csrf token and how will you add csrf token in ajax?
What are the common uses of php?
What is xss and csrf?
What does the php error 'parse error in php - unexpected t_variable at line x' means?
Is session a cookie?
How to convert strings to numbers in php?
What is php rest api?
How to check if a string contains a character or word in php?
how can i develop forum code? any one pleale help me on this question
Tell us how can we access the data sent through the url with the post method?
How to register a variable in PHP session?
What is the output of the ucwords function in this example?
Do you know what are traits?