Monday, April 16, 2012

Making clean string for SEO friendly urls using php

SEO stands for search engine optimization, and it is very important aspect of web business and its success. In order to make a website SEO friendly, we have to take care or many SEO rules. One of which is SEO friendly urls. SEO friendly url should have meaningful keywords so that spider can find the exact content of page.

The function to make clean url is

 private function clean_url($text)  
  {  
       $text=strtolower($text);  
       $code_entities_match = array(' ','--','&quot;','!','@','#','$','%','^','&','*','(',')','_','+','{','}','|',':','"','<','>','?','[',']','\\',';',"'",',','.','/','*','+','~','`','=','"');  
       $code_entities_replace = array('-','-','','','','','','','','','','','','','','','','','','','','','','','','');  
       $text = str_replace($code_entities_match, $code_entities_replace, $text);  
       return $text;  
 }  

took help from http://www.9lessons.info/2011/04/seo-friendly-urls-with-php.html

8 comments:

  1. http://our-knowledge-base.blogspot.com/2012/04/making-clean-string-for-seo-friendly.html

    ReplyDelete
  2. Nice, that helped me, thanks

    ReplyDelete
  3. One of which is SEO friendly urls. SEO friendly url should have meaningful keywords so that spider can find the exact content of page.backlinks link building

    ReplyDelete
  4. Nice article this helped me a lot for my website www.dailytelecominfo.com

    ReplyDelete
  5. Seo is a best process to improve your website rank on search engine, sober living ny

    ReplyDelete

Please feel free to post your comments. If anyone has a good article or good thing to share, just send me that with your name to asadmehmoodstar@gmail.com. and if anyone want so receive updates regarding my blog, he can subscribe to my weekly newsletter on "Subscribe to our mailing list" section.

Thanks