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, 4837👍, 0💬
Popular Posts:
How To Create Nested Tables? - XHTML 1.0 Tutorials - Understanding Tables and Table Cells You can cr...
How To Create an Add-to-Google-Reader Button on Your Website? - RSS FAQs - Adding Your Feeds to RSS ...
Which bit wise operator is suitable for turning off a particular bit in a number? The bitwise AND op...
What are database triggers? How are the triggers fired? Read this collection of questions and answer...
What Is C Language? The C programming language is a standardized programming language developed in t...