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 / ramse
yes we can do this also.
But pass by reference allow in PHP5 not in PHP4.
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
How to remove an empty directory?
Write a php script to get the largest key in an array?
Which array function checks if the particular key exists in the array?
What is use of echo in php?
What happens if an expected input field was not submitted?
What is the default time of cookie in php?
How do you end a session in php?
What are classes in php?
Explain me what is the importance of "method" attribute in a html form?
What are the correct and the most two common way to start and finish a PHP block of code?
What is the interface in php?
What is the difference between file_get_contents() and file_put_contents() in php?
How to call a php function from another php file?
Do you know how to delete a file from the system?
Tell me how is it possible to parse a configuration file?