php获取当前URL地址和参数解决方案

WBOY
Release: 2016-06-13 13:31:05
Original
966 people have browsed it

php获取当前URL地址和参数
http://biao.lequj.com/pin-index-cat-6-tag-Casio/%E5%8D%A1%E8%A5%BF%E6%AC%A7.html

php如何获取tag-后面的参数

------解决方案--------------------

PHP code

$str = 'http://biao.lequj.com/pin-index-cat-6-tag-Casio/%E5%8D%A1%E8%A5%BF%E6%AC%A7.html';
preg_match('/tag-(.*).html$/i', $str, $match);
if (isset($match[1]))
    echo urldecode($match[1]); <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template