fork download
  1. <?php
  2.  
  3. function get_keywords($text) {
  4.  
  5. $pattern = '/[\\w!"#$%&\'()=~^\\\\|`@[{+;*:}\\]<,>.?\\/ -]++/';
  6. preg_match_all($pattern, strip_tags($text), $matches);
  7. return $matches[0];
  8.  
  9. }
  10.  
  11.  
  12. ?>
  13. PHP: Hypertext Preprocessorとは、動的にHTMLデータを生成することによって、動的なウェブページを実現することを主な目的としたプログラミング言語、およびその言語処理系である。<br>
  14. 詳しくは以下のURLを参照されたし。<br>
  15. <a href="http://j...content-available-to-author-only...a.org/wiki/PHP:_Hypertext_Preprocessor">リンク</a>
  16. <?php
  17.  
  18. var_dump(get_keywords(ob_get_clean()));
  19.  
  20.  
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
array(3) {
  [0]=>
  string(27) "PHP: Hypertext Preprocessor"
  [1]=>
  string(4) "HTML"
  [2]=>
  string(3) "URL"
}