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 purpose of break and continue statement?
What are psrs?
Explain how is it possible to set an infinite execution time for php script?
What is session in PHP. How to remove data from a session?
Can a super () and this () keywords be in same constructor?
What is curl php?
What is the purpose of basename() function in PHP?
What is beforeRender() used?
If we login more than one browser windows at the same time with same user and after that we close one window, then is the session is exist to other windows or not? And if yes then why? If no then why?
How can php and javascript interact?
Name some of the popular frameworks in php.
What’s the difference between htmlentities() and htmlspecialchars()?
What is php date function?
How many open modes available when a file open in PHP?
What is php crud api?