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, 4641👍, 0💬
Popular Posts:
How do we host a WCF service in IIS? Note: - The best to know how to host a WCF in IIS is by doing a...
What does a special set of tags <?= and ?> do in a PHP script page? <?= express...
How To Get the Last ID Assigned by MySQL? - MySQL FAQs - Managing Tables and Running Queries with PH...
How To Run "mysql" Commands from a Batch File? - MySQL FAQs - Command-Line End User Interface mysql ...
How do I use a scriptlet to initialize a newly instantiated bean? A jsp:useBean action may optionall...