SEO友情链接,js和/或php剥离 [英] SEO Friendly links, js and/or php stripping
本文介绍了SEO友情链接,js和/或php剥离的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经看到这是在wordpress上完成的,我无法访问word press:)
I have seen this being done on the wordpress and i dont have access to word press :)
但我需要返回一个url字符串,删除任何无效字符从它并将一些字符转换成适当的字符:)
but i need to return a url string removing any non valid characters from it and converting some characters into appropriate characters :)
例如
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,inetccc
and remove common and senseless words such as "the","a","in" etccc
至少指出我正确的方向,如果你有一个gd代码:)
at least point me on the right direction if u dnt have a gd code :)
推荐答案
你想要的是slugged字符串。以下是相关链接列表:
What you want is the "slugged" string. Here's a list of relevant links:
- 最好的逃生方法和创造一个slu
- 将任何标题转换为url slug并从url slug转回标题
- 如何在php中生成slu
- http://snipplr.com/查看/ 2809 / convert-string-to-slug /
- best way to escape and create a slug
- Convert any title to url slug and back from url slug to title
- how to generate slugs in php
- http://snipplr.com/view/2809/convert-string-to-slug/
只需谷歌 PHP slug
更多示例。
这篇关于SEO友情链接,js和/或php剥离的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文