如何在PHP数组中添加冒号?

时间:2018-11-01 15:41:42

标签: php arrays

我有以下X程序员编写的代码。我正在修改它。

Config::registerSites(
                array(
                        /** -- Site Defaults -- * */
                        "defaults" => array(
                                "site_name" => "some name",
                                "owner" => "Some Owner",
                                "copyright" => "Some Copywrite",
                                "site_version" => "1.0",
                                "mobile" => true

                        ),
                        /** -- Frontend -- * */
                        "frontend" => array(
                                "mysite" => array(
                                        "site_name" => "some name",
                                        "testing" => array("test.somesite.com" => "desktop", "m.test.somesite.com" => "mobile"),
                                        "live" => array("staging.somesite.com" => "desktop", "m.somesite.com" => "mobile"),
                                        "mobile" => true,
                                        "default_locale" => "gb"
                                )
                        )
)

我想在URL前面添加https://。如下图所示。

Config::registerSites(
                array(
                        /** -- Site Defaults -- * */
                        "defaults" => array(
                                "site_name" => "some name",
                                "owner" => "Some Owner",
                                "copyright" => "Some Copywrite",
                                "site_version" => "1.0",
                                "mobile" => true

                        ),
                        /** -- Frontend -- * */
                        "frontend" => array(
                                "mysite" => array(
                                        "site_name" => "some name",
                                        "testing" => array("https://test.somesite.com" => "desktop", "https://m.test.somesite.com" => "mobile"),
                                        "live" => array("https://www.somesite.com" => "desktop", "https://m.somesite.com" => "mobile"),
                                        "mobile" => true,
                                        "default_locale" => "gb"
                                )
                        )
)

当我尝试使用此URL https://www.somesite.com从浏览器访问页面时,出现错误,并且浏览器中的URL显示https // www.somesite.com。冒号(:)已删除。我究竟做错了什么?

请,您能帮到大家吗?

0 个答案:

没有答案