Array problem Help

Source: Internet
Author: User
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

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.