Aaron:
On Sun, Feb 25, 2007 at 03:47:45PM -0500, Aaron Fischer wrote:
> I need to copy an array by value, not by reference. Is there a best
> way to do this? Right now I found serialize/unserialize which seems
> to do the trick.
What ARE you talking about? Copying by value is the default behavior in
PHP.
INPUT:
$a1 = array('a', 'b');
$a2 = $a1;
$a1[0] = 'changed';
print_r($a1);
print_r($a2);
OUTPUT:
Array
(
[0] => changed
[1] => b
)
Array
(
[0] => a
[1] => b
)
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php