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
Is numeric in php?
What are the steps involved to run php?
What is a php object?
Which programming language does php resemble?
Distinguish between urlencode and urldecode?
How to break a file path name into parts?
Which is best framework for php?
Is java is better than php?
Can we override static method?
Is it more secure to use cookies to transfer session ids?
How to convert a string to uppercase in php?
Explain me what are the 3 scope levels available in php and how would you define them?
Is php easier than node?
How escape single quotes php?
How can you execute php script from the command line?