/ Published in: PHP
ã‚ーワードをãƒã‚¤ãƒ©ã‚¤ãƒˆã™ã‚‹ã‚ˆã†ã«HTMLã§ãŠãã‹ãˆã‚‹ã€‚
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function highlight($sString, $aWords) { return false; } return preg_replace ('@\b('.$sWords.')\b@si', '<strong style="background-color:yellow">$1</strong>', $sString); }