3
這是我目前的php腳本。如何確定計數並從結果中隨機編輯?
$mystr = 'Hello world. The world is nice';
substr_count($mystr, 'world'); // count=2;
$mytext = preg_replace('/\b('.$mystr.')\b/i', '<b>$1</b>', $mytext);
我想隨機將這個單詞中的一個以粗體顯示。 有什麼聰明的方法嗎? THX先進,史蒂芬
你想讓'世界'事件之一是大膽的,或_any_一個字? – Dogbert 2011-05-29 11:05:20