Home  >  Article  >  Backend Development  >  php获取当前URL地址和参数解决方案

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

WBOY
WBOYOriginal
2016-06-13 10:23:24959browse

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>
Statement:
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