Ok, so this is a super-newb question...
When creating an array, is there any way I could assign a key's value to another key in the same array?
For example:
<?php
$foobarr = array (
0 => 'foo',
1 => $foobarr[0] . 'bar',
);
?>
In this example $foobarr[1]
holds the value 'bar'.
Any way I can do this so that $foobarr[1] == 'foobar'
?
=
is evaluated before it is assigned to$foobarr
so within the array construct$foobarr
doesn't exist yet. – Emissary Mar 13 '13 at 13:53$foobarr[] = "foo"; $foobarr[] = $foobarr[0]."bar";
– jdstankosky Mar 13 '13 at 13:57