Online Keyword Research Tool Online keyword research tool help you select keyword and research keyword for internet marketing or SEO (Search Engine Optimization), You can find how many search times last month on internet for your keywords and get a keyword list. Deep analyze option can help you find all combined keywords and search times. The keyword list and research report can be downloaded as CSV format. Now include Related Keyword Generator. Data source is come from Overture and Google Adword.
表单提交过来,不过发现计算的字符不准, 说大概的思路,获取远程页面,计算页面长度,一般是字节, 然后计算关键字长度, 关键字在所有页面长度上出现的次数, 总长度=次数*长度 出现的密度=总长度/页面长度/100 最后就是输出,没任何技术含量。 PHP: <?php /****** 作用:关键字长度检索 Date:2006-4-20 Author:blue2004 Email:[email protected] ******/ $url ="http://".$_POST["site"]; if ($url){ $url="http://www.chinahtml.com/index.shtml"; } $key =$_POST['key']; //读取内容 function readurl($url){ $file=@fopen("$url","r"); while(!feof($file)) { $content .= fread($file,4096); } return $content; } //字符长度计算,中文算两,英文数组算1 function utf8_strlen($str){ $count = 0; for($i = 0; $i < strlen($str); $i++){ $value = ord($str[$i]); if($value > 127) { if($value >= 192 && $value <= 223) $i++; elseif($value >= 224 && $value <= 239) $i = $i + 2; elseif($value >= 240 && $value <= 247) $i = $i + 3; else //die('Not a UTF-8 compatible string'); $i++; } $count++; } return $count; } //计算出现的次数 function str_count($str,$needle,$case=0){ if(!$str || !$needle) return 0; if($case){ preg_match_all("/(".$needle.")/is",$str,$matches); }else{ preg_match_all("/(".$needle.")/s",$str,$matches); } return count($matches[1]); } $string =readurl($url); $length =utf8_strlen($string); $counts=str_count($str=$string,$needle=$key,$case=0); $keyleng=utf8_strlen($key); $all =$counts*$keyleng; $midu =$counts*$keyleng/$length*100; echo "您检索的关键字:{$key}<br />"; echo "页面代码总长度:{$length}字节<br />"; echo "关键字出现频率:{$counts}次<br />"; echo "关键字符串长度:{$keyleng}字节<br />"; echo "关键字符总长度:{$all}字节<br />"; echo "密度结果计算:{$midu}<br />"; echo "密度建议值:1%≦密度≦8%<br />"; echo "<a href='index_key.html'>返回</a>";