如何从一个数组中的网页中获取所有唯一的单词?(没有所有属性和javascript等)?
有人能帮我这个忙吗?
发布于 2010-10-19 08:14:49
看一看http://simplehtmldom.sourceforge.net/
然后做一些类似的事情:
<?php
include_once('simplehtmldom/simple_html_dom.php');
$string = file_get_html('http://www.google.com')->plaintext;
$words = preg_split('/[\s,.]+/', $string, null, PREG_SPLIT_NO_EMPTY);
var_dump(array_unique($words));
?>
发布于 2010-10-19 01:47:09
试试这个get_text这个会帮到你的:http://mel.melaxis.com/devblog/2005/08/06/localizing-php-web-sites-using-gettext/
https://stackoverflow.com/questions/3961335
复制相似问题