Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我正在尝试这样做
$system = array( 'key1' => 'val1', 'key2' => 'val2', 'key3' => $system['key1'].'val3' );
但是当我们回显 key3 时,它最终只是“val3”而不是“val1val3”。
有没有办法解决这个问题?
谢谢!
您可以在声明$system/后分配它key1:
$system
key1
$system = array('key1' => 'val1', 'key2' => 'val2'); $system['key3'] = $system['key1'] . 'val3';