PHP: Array Add keyword links to articles, like 163 article content, automatically add link effects
- $keys =array(
- array('Web page effects','/js_a/js.html'),
- array('seo','/seo/seo.html'),
- array('php','/phper/php.html'),
- array('jsp','/jsp/jsp.html'),
- array('asp','/asp/asp.html'),
- array('ps','/fw/photo.html'),
- array('photoshop','/fw/photo.html'),
- array('javascript','/js_a/js.html') ,
- array('.net','/net/net.html'),
- array('non-mainstream','/fw/photo.html'),
- array('network','/mon/mon. html'),
- array('css','/cssdiv/css.html'),
- array('graphic design','/fw/photo.html'),
- array('website','/person/ '),
- array('Web page production','/wy/yw.html'),
- array('Search engine','/seo/seo.html'),
- array('Optimization','/seo/ seo.html'),
- array('animation','/flash_a/flash.html'),
- array('database','/database/database.html'),
- array('make money','/ mon/mon.html'),
- array('Operation','/mon/mon.html')
-
- );
-
- $str = "Today is May 30, 2010. There is a problem with my website. There are many questions about seo. seo is search engine optimization. I used to learn php, but now I think jsp is better, css+div, web page, web design, web page production, web page learning, web page teaching, Photoshop, Flash, HTML, CSS, Dreamweaver,Fireworks,ASP,PHP,JSP,asp.net,website construction,website development,webpage special effects,graphic design,personal website,webpage materials";
- echo $str,"
";
- foreach( $keys as $nkeys){
- //print_r($nkeys);echo"
";
- //foreach( $nkeys as $join) {
- //echo($join),"
";
- if(strpos($str,$nkeys[0]) ){
- $str =str_replace($nkeys[0],"".$nkeys[0]."",$str);
- }
- //}
- }
-
- echo $str;
- ?>
-
-
Copy code
|