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 / sunil kumar
<?php
$a = 10;
$b = 20;
echo $a, $b;
$a=$a+$b;
$b=$a-$b;
$a=$a-$b;
echo "<br>";
echo $a, $b;
?>
| Is This Answer Correct ? | 9 Yes | 2 No |
Post New Answer View All Answers
What is php ci?
How to access a specific character in a string?
What is php written in?
Does mysql need php?
What are headers in php?
What is mvc? Why its been used?
How many types of arrays are there in php?
What is oops php?
Describe session in php.
Tell me what is use of in_array() function in php?
i m a B.E,passed out few yrs bak failed to find good job due to less marks now thinkin of a career as PHP developer. is it a lucarative field and wat r career prospects; hv heard dat initial salary is very less bout 6k also most jobs r contrct jobs.pls guide me need ur valuable advice.pls hellppp!! thnx..
How can you retrieve a cookie value?
What is the timeout period on session values?
What is cookie and why do we use it?
Is php 5.6 secure?