将变量添加到数组内的路径中

时间:2015-01-21 18:27:13

标签: php

是否可以以粗体添加变量?

$opts = array(
    // 'debug' => true,
    'roots' => array(
        array(
            'driver'        => 'LocalFileSystem',   // driver for accessing file system (REQUIRED)
            **'path'          => '/csgo',         // path to files (REQUIRED)**
            'URL'           => dirname($_SERVER['PHP_SELF']) . '/../files/', // URL to files (REQUIRED)
            'accessControl' => 'access'             // disable and hide dot starting files (OPTIONAL)
        )
    )
);

将其改为此无济于事

'path'          => ".$folder./csgo",         // path to files (REQUIRED)

谢谢

1 个答案:

答案 0 :(得分:0)

应该是:

'path' => "$folder/csgo"

稍微好一点的方法:

'path' => "{$folder}/csgo"

这清楚地显示了变量与字符串的分离