我有这样的网址:
www.studyenglish/index.php?r=site/lesson&act=read&id=1
我希望更改为:
www.studyenglish/site/lesson/read
我已在 url 管理器 config/main.php 中添加了此脚本
'urlManager'=>array(
       ....
       'showScriptName'=>false,
        ....
    ),
Run Code Online (Sandbox Code Playgroud)
并将此脚本添加到 .htaccess 中
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
Run Code Online (Sandbox Code Playgroud)
但它只适用于这样的 url:
www.studyenglish/index.php?r=site/lesson
成为:
www.studyenglish/site/lesson
那么,如何更改此网址
www.studyenglish/index.php?r=site/lesson&act=read&id=1
成为
www.studyenglish/site/lesson/read
希望有人可以提供帮助。谢谢 ...
如何计算值为空的数组的数量。例如,我有数组结果:
    Array (
       [0] => 'A',
       [1] => 'B',
       [2] => 'C',
       [3] => '',
       [4] => '',
       [5] => 'F',
       [6] => '')
Run Code Online (Sandbox Code Playgroud)
这里有3个空数组值(索引3,4,6),那么如何获取空数组值的数量