投稿タイトルからキーワードを作成し、投稿全体の各単語を置き換える関数を作成しました。
これが私の機能です
function myseonew($title,$text){
$title = stripslashes($title);
$text = stripslashes($text);
$fburl = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$keywords = explode(" ",$title);
$regex = '/('.implode('|', $keywords).')/i';
$output = preg_replace($regex, '<a id="smalltext" href="'.$fburl.'">\\1</a>', $text);
return $output;
}
but i faced a problem for the output the characters all of it comes ( �������� ).
so is there any way to solve this issue
by the way my encoding is UTF-8
regards