小编Zhl*_*tam的帖子

重定向到trailng斜杠(htaccess)

尝试向每个链接添加尾部斜杠.即http://mysite.com/products应该将301重定向到http://mysite.com/products/等.但是如何?这是htaccess:

RewriteEngine on
DirectoryIndex index.php
Options -Indexes
RewriteBase /

RewriteCond %{REQUEST_URI} \.css$
RewriteCond %{QUERY_STRING} ^pack$
RewriteRule ^(.*)$ /modules/system/css_compactor.php?filename=$1 [L]
RewriteCond %{REQUEST_URI} \.js$
RewriteCond %{QUERY_STRING} ^pack$
RewriteRule ^(.*)$ /modules/system/js_compactor.php?filename=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php
RewriteRule /admin/(.*)$ /admin/index.php
Run Code Online (Sandbox Code Playgroud)

需要帮忙!

.htaccess apache2

2
推荐指数
1
解决办法
1138
查看次数

字母数字数组排序(CAVEAT:空格作为千​​位数字分隔符)

怎么做.例如,我们有一个数组:

array(
    0 => 'Regular 1 000',
    1 => 'Regular 500',
    2 => 'Regular 2 000',
    3 => 'Big',
    4 => 'Regular 1 000 000',
    5 => 'Regular 50 000'
)
Run Code Online (Sandbox Code Playgroud)

我需要按顺序放置它们:

array(
    3 => 'Big',
    1 => 'Regular 500',
    0 => 'Regular 1 000',
    2 => 'Regular 2 000',
    5 => 'Regular 50 000',
    4 => 'Regular 1 000 000'
 )
Run Code Online (Sandbox Code Playgroud)

我需要维护索引关联.看来我需要使用uasort.任何人都可以向我建议一个用于callable ( $cmp_function )价值的功能 吗?

php sorting

2
推荐指数
1
解决办法
444
查看次数

标签 统计

.htaccess ×1

apache2 ×1

php ×1

sorting ×1