Home  >  Article  >  Backend Development  >  PHP implements code to add internal link keyword replacement to article content

PHP implements code to add internal link keyword replacement to article content

WBOY
WBOYOriginal
2016-07-25 08:57:281380browse
  1. /**

  2. * Replacement of content keywords
  3. * edit: WWW.JBXUE.COM
  4. */

  5. $ci=array("Short URL"=>"http:// jbxue.com","URL shortening"=>"http://jbxue.com");

  6. //The content field is content

  7. $content="Shortening URL is a good tool" ;
  8. foreach($ci as $k=>$v){
  9. $str=''.$k.'';
  10. $content=ereg_replace($k,$str,$content);
  11. }
  12. echo $content;

Copy code

Attached, keyword replacement in empire cms Code:



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn