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 / nikunj kansara
$x=$a;
$a=$b;
$b=$x;
echo $a.",".$b;
| Is This Answer Correct ? | 11 Yes | 4 No |
Post New Answer View All Answers
What is the difference between indexed and associative array?
Is php worth learning in 2019?
Why php language is used?
What does empty mean in php?
What does $_files means?
Why is used in php?
Does php support inheritance?
How do you remove whitespace from the beginning and end of a $string variable?
Is a number php?
What is the use of the function 'imagetypes()'?
What are php strings?
Explain php split() function.
How to execute a php script from the command line?
What is whitespace in php?
What is an abstract class in php?