문제

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