php正则连接中文本程序

  1. $htm = "<a href='http://www.phpfensi.com'>test1</a><br />" .
  2. "<a href='http://www.phpfensi.com'>test2</a><br />" .
  3. "<a href='http://www.phpfensi.com'>test3</a><br />" .
  4. "<a href='http://www.phpfensi.com'>test4</a><br />" .
  5. "<a href='http://www.phpfensi.com'>test5</a><br />";
  6. echo $htm . "<br />";
  7. echo stripthetag($htm);
  8. function stripthetag($link) {
  9. return (preg_replace('@<[/!]*?[^<>]*?>@si', ' ', $link));
  10. }