Php
, in a single configuration room with this return array (), how can I refer to the value of the first element in the value of the second element?
Reply to discussion (solution)
The goal is just ' a ', ' B ' linkage, right? Dummy one more variable, three linkage on the line
$a = Array (' a ' = = 1, ' b ' = & $a [' A '], ' c ' = 3); It is not possible to write this, because there is no execution, $a [' a '] does not exist
$a [' b '] = & $a [' a ']; So that we can
You can use this code to understand the effect
$a = Array (' a ' = = 3); $a = Array (' a ' = = 1, ' b ' = & $a [' A '], ' C ' + 3),//$a [' B '] = & $a [' A '];p rint_r ($a); echo $a [' B '];
You can use this code to understand the effect
$a = Array (' a ' = = 3); $a = Array (' a ' = = 1, ' b ' = & $a [' A '], ' C ' + 3),//$a [' B '] = & $a [' A '];p rint_r ($a); echo $a [' B '];
I am in a php configuration file, the entire file is the return array (). Operation can only be performed within an array ().
The requirement itself is meaningless: does one member refer to another member, not superfluous?
The requirement itself is meaningless: does one member refer to another member, not superfluous?
Maybe I didn't design it well.
Then I have such a code file:
Return Array (
' Domain ' = ' http://www.xxx.com/',
' js ' = ' http://www.xxx.com/js ',
' img ' = ' http://www.xxx.com/img ',
' CSS ' = ' http://www.xxx.com/css '
);
?>
This next side can not be repeated to write http://www.xxx.com/this, but directly with a variable or constant to replace it?
The values of your 4 elements are different, how do you repeat them?
If you don't want http://www.xxx.com/, don't write.
http://www.xxx.com/is your website, not someone else's. There's no need to write
The values of your 4 elements are different, how do you repeat them?
If you don't want http://www.xxx.com/, don't write.
http://www.xxx.com/is your website, not someone else's. There's no need to write
These four values are partly repetitive.
Of course I am to cite an example, not necessarily the domain name.
Don't you understand the nature of the question I want to ask, do I not express it clearly?
Of course I know what you mean!
I also told you why this can't be done.
1, either declare a temporary variable before the return
2, either after the return of the processing, that is, the return array does not contain the B element, the subsequent logic to determine that there is no B element, then let the B element =a the value of the element