Php for array problems
The return array () array exists in a single configuration room. how can I reference the value of the first element in the value of the second element?
Reply to discussion (solution)
The purpose is to associate 'A' and 'B? If you want to add another variable, trigger the trigger.
$ A = array ('a' => 1, 'B' => & $ a ['A'], 'C' => 3 ); // This write method is not feasible because it is not executed and $ a ['A'] does not exist.
$ A ['B'] = & $ a ['A ']; //
You can understand the effect of this code
$a = array('a' => 3);$a = array('a' => 1, 'b' => &$a['a'], 'c' => 3);//$a['b'] = &$a['a'];print_r($a);echo $a['b'];
You can understand the effect of this code
$a = array('a' => 3);$a = array('a' => 1, 'b' => &$a['a'], 'c' => 3);//$a['b'] = &$a['a'];print_r($a);echo $a['b'];
I am in a php configuration file, and the entire file is return array (). Operations can only be performed in array.
The requirement itself is meaningless: does one member reference another?
The requirement itself is meaningless: does one member reference another?
Maybe I didn't design it.
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'
);
?>
Can I repeat http://www.xxx.com/to replace it with a constant variable?
Why are the values of the four elements different?
Don't want http://www.xxx.com/just don't write
Http://www.xxx.com/is your website, not someone else's. You do not need to write
Why are the values of the four elements different?
Don't want http://www.xxx.com/just don't write
Http://www.xxx.com/is your website, not someone else's. You do not need to write
Some of the four values are repeated.
Of course, this is an example, not necessarily a domain name.
Haven't you understood the nature of the question I want to ask yet?
Of course I know what you mean!
I also told you why this cannot be done.
1. either declare a temporary variable before return
2. either process after return, that is, return array does not contain element B. Then, if no element B is determined by the logic, the value of Element B is equal to the value of element.