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.