<code>if (strpos($_SERVER["REQUEST_URI"], "/CHA")===0 ) { $end = strpos($_SERVER["REQUEST_URI"], "/", 1); $channel = substr($_SERVER["REQUEST_URI"], 1, $end-1); $channelConfig = pc_base::load_config('channel'); if ( !empty($channel) && isset($channelConfig[$channel]) ) { setcookie("channel", $channel, time()+7*86400, "/"); } } </code>
phpcms中index.php裡的這段程式碼我懂程式碼意思,但不知道這樣有何意義,是不是phpcms裡面一般都這樣?
<code>if (strpos($_SERVER["REQUEST_URI"], "/CHA")===0 ) { $end = strpos($_SERVER["REQUEST_URI"], "/", 1); $channel = substr($_SERVER["REQUEST_URI"], 1, $end-1); $channelConfig = pc_base::load_config('channel'); if ( !empty($channel) && isset($channelConfig[$channel]) ) { setcookie("channel", $channel, time()+7*86400, "/"); } } </code>
phpcms中index.php裡的這段程式碼我懂程式碼意思,但不知道這樣有何意義,是不是phpcms裡面一般都這樣?