我從數據庫中獲取一些數據,然後從數據創建一個鏈接。在mysql行中使用urlencode php
<a href=\"news/people/" . urldecode($row['title']) . ".html\" target=\"_self\">"
輸出鏈接是http://wwww.website.com/news/people/ask+question+stack.html
因此而不必在鏈接的加號,我會喜歡的hve連字符 鏈接這樣http://wwww.website.com/news/people/ask-question-stack.html
感謝您的幫助 新手
+是一個空間 – bumperbox
編碼值的URL這是否幫助:urldecode(str_replace函數( 「+」, 「 - 」,$行[ 'title']))? – Maximus2012
[php函數使slu((url字符串)]可能重複](http://stackoverflow.com/questions/2955251/php-function-to-make-slug-url-string) –