I'm working on an HTML page with bookmark links (a href/a id) and when I validated the page on W3C the validator told me that whitespace wasn't allowed in links and that I should replace it with %20 and so I did with a PHP function. After doing that my bookmark links stopped working. Then, instead of replacing the whitespace with %20 I tried replacing it with an empty string ("") and thus removed the whitespace altogether and my bookmarks started working again. Can anybody explain this?

有帮助吗?

解决方案

Some PHP code might be helpful but I think it's enough if you use urlencode() function. It will auto-magically convert any string to match the URL standards.

Here's the REFERENCE.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top