php-general | 2005051
Date: 05/04/05
- Next message: Dan Rossi: "Re: [PHP] XSL:FO + PHP"
- Previous message: Sebastian: "Re: [PHP] regex"
- Next in thread: Chris: "Re: [PHP] Function shall receive Pointer to Array"
- Reply: Chris: "Re: [PHP] Function shall receive Pointer to Array"
- Reply: Fred Rathke: "Re: [PHP] [SOLVED] Function shall receive Pointer to Array"
- Reply: Richard Lynch: "Re: [PHP] Function shall receive Pointer to Array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
how can a function get a pointer to an array? This does not work. I use
PHP4.
$t = array("test" => "unchanged");
echo "<br>testarray unchanged:\"".$t['test']."\"";
changearray($t);
echo "<br>testarray hopefully changed:\"".$t['test']."\"";
function changearray(&$myarray) {
$myarray['test'] = "changed";
}
Before I tried it on my own I read this page:
http://de2.php.net/manual/en/language.references.whatdo.php
Be so nice to search for this string: "The second thing references do
is to pass variables by-reference. This is done by making a local
variable in a function and a variable in the calling scope reference
to the same content. Example:"
The following example I used. I only tried to do it with an array
instead of a variable.
What I need to read again to find my own mistake? I know some of php's
commands work with an internal copy of a content.
Thanks for your help and advice.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Dan Rossi: "Re: [PHP] XSL:FO + PHP"
- Previous message: Sebastian: "Re: [PHP] regex"
- Next in thread: Chris: "Re: [PHP] Function shall receive Pointer to Array"
- Reply: Chris: "Re: [PHP] Function shall receive Pointer to Array"
- Reply: Fred Rathke: "Re: [PHP] [SOLVED] Function shall receive Pointer to Array"
- Reply: Richard Lynch: "Re: [PHP] Function shall receive Pointer to Array"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

