Is it possible to have an array assign its own element value to one of its other elements at the time you declare the array?
Here's a code example:
$arr = array ( 0 => '<ul class="'.$arr[1].'">', 1 => 'some_class' );
echo $arr[0]; // <ul class="some_class">
I've tried passing by reference (&$arr[1] instead of $arr[1] in the above code), but it gives a syntax error.
$arron the left side of the assignment won't exist until the right-hand side's been evaluated, and$arr[1]in the right-hand side can't exist until the right-hand side completes and gets assigned to the left-hand side. e.g. you're trying to count your chickens before chickens even existed.