-1

我可以用 PHP 或任何其他方式做到这一点吗?我想引用数组中的另一个元素。

$config = array(
    'factory-code'  => array(
        '01', '02'
    ),
    'commodity-filter'  => array(
        'factory' => array(
            'steel'     => array( $this->factory-code ),
        ),
        'branch' => array(
            'steel'     => array( $this->factory-code, '09' ),
        )
    )
);
4

1 回答 1

0

您必须在单独的数组中创建工厂代码

$factory_code  => array('01', '02');

$config = array(
    'factory-code'  => $factory_code,
    'commodity-filter'  => array(
        'factory' => array(
            'steel'     => array( $factory_code ),
        ),
        'branch' => array(
            'steel'     => array( $factory_code, '09' ),
        )
    )
);
于 2012-09-16T14:31:47.523 回答