1
<?
echo "Begin Function=";
echo "<br>";
$text = "2lyve: this is: 8475978474957845 948594: jfhdhfkd: just the 2lyve: beginning:";
function getTrends($text)
{
$subject = $text;
$pattern ='/(\w+:)/Ui';
preg_match_all($pattern, $subject, $matches);
foreach($matches[1] as $value)
{
print $value."<br>";
}
}
getTrends($text);
?>
結果將是:Preg_match_all計數器?
Begin Function=
2lyve:
is:
948594:
jfhdhfkd:
2lyve:
beginning:
如何指望有多少次返回每個結果和排名嗎?另外,如何將這些結果導入到sql數據庫中?
感謝。我也調整了一下,打印出一個乾淨的格式,但我仍然試圖按發生次數對它們進行排名 – ImJeaniusDoe 2013-03-26 16:15:49