我从数据库中获取一些数据,然后从数据创建一个链接。在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) –