Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. // $foo is de zin en $array is de array met keyvalues
  2. function explodeSentence($foo, $array) {
  3. $sntc = "";
  4. strtolower($foo);
  5. $str = explode(" ", $foo);
  6.  
  7. foreach($str as $word) {
  8. if($array[$word] > 1) {
  9. $sntc .= "<span style='background-color: yellow;'>$word</span> ";
  10. } else {
  11. $sntc .= $word;
  12. }
  13. }
  14.  
  15. return $sntc;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement