【发布时间】:2026-01-10 01:40:01
【问题描述】:
我已经看到这是在 wordpress 上完成的,但我无法访问 wordpress :)
但我需要返回一个 url 字符串,从中删除任何无效字符并将一些字符转换为适当的字符:)
例如
1+ characters should be converted (of the following)
[space] = [dash] (1 dash) >>> (-)
[underscore] = [dash] (1 dash) >>> (-)
$str = 'Hello WORLD this is a bad string';
$str = convert_str_to_url($str);
//output//NOTE: caps have are lowercase :)
//hello-world-bad-string
并删除常见且无意义的单词,例如“the”,“a”,“in”等cc
如果你没有 gd 代码,至少给我指出正确的方向:)
【问题讨论】:
标签: php javascript url seo