Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
Can You Define an Argument as a Reference Type
Can You Define an Argument as a Reference Type? - PHP Script Tips - Creating Your Own Functions
✍: FYIcenter.com
You can define an argument as a reference type in the function definition. This will automatically convert the calling arguments into references. Here is a PHP script on how to define an argument as a reference type:
<?php function ref_swap(&$a, &$b) { $t = $a; $a = $b; $b = $t; } $x = "PHP"; $y = "JSP"; print("Before swapping: $x, $y\n"); ref_swap($x, $y); print("After swapping: $x, $y\n"); ?>
This script will print:
Before swapping: PHP, JSP After swapping: JSP, PHP
2007-04-24, 4687👍, 0💬
Popular Posts:
How To Build WHERE Criteria with Web Form Search Fields? - MySQL FAQs - Managing Tables and Running ...
Why is there extra white space before or after tables? This is often caused by invalid HTML syntax. ...
What are different properties provided by Objectoriented systems ? Following are characteristic’s of...
What is DAR (Decision Analysis and Resolution) ? Decision Analysis and Resolution is to analyze poss...
.NET INTERVIEW QUESTIONS - What are types of compatibility in VB6? There are three possible project ...