SEO友情链接,js和/或php剥离 [英] SEO Friendly links, js and/or php stripping

查看:151
本文介绍了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:

  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆