|
||||||
| PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Have you tried using an array to pass each argument back?
function fn($arg1, $arg2) { return array($arg1, $arg2); } Use the List function to set variables after calling your function like so: list($var1, $var2) = fn(1, 2); This will simply set $var1 to '1' and $var2 to '2' Last edited by Thomas; 09-27-2006 at 12:58 PM. |
|
|||
|
Pass by reference essentially sets a pointer to the original variable's memory location so that you can "pass" the variable on to the function without needing to create a duplicate of the variable. And when the function changes the variable it also changes outside the function since the function is changing the same memory location that the original variable also points too.
For example PHP Code:
|
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A simple TicTacToe game | Zunone | C and C++ | 1 | 08-16-2007 12:01 PM |
| Dictonary Program | programmer 101 | Java Help | 9 | 07-01-2007 02:39 PM |
| null exception problem | connor7777 | C# Programming | 2 | 03-28-2007 12:37 PM |
| Flex, bison multifunction calculator | annatsos | C and C++ | 1 | 01-04-2007 07:00 AM |
| Get and Set Functions | Chan | C# Programming | 3 | 08-25-2006 12:44 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 98%