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


Please Help Members By Posting Answers For Below Questions

What is the main difference between asp net and php?

532


What is basic php?

543


How does the identity operator ===compare two values in PHP?

653


How many columns can be added in a table in mysql?

498


Difference between array_combine and array_merge?

529






What are psrs?

605


Is not null mysql?

547


Does php support multithreading?

561


how retrive the video file in php using video tag

1380


Is python similar to php?

550


What is an anti csrf token?

506


Are sessions stateless?

488


Why do we use php?

540


What is the use of hooks?

535


What is an abstract class in php?

480