Pintar un texto (highlight)


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function pintar( $str ){
  2. global $q; #str buscado
  3. if( strlen( trim( $q ) ) > 0 ) {
  4. return str_replace($q, '<font style="background-color:#DCE7A5">'.$q.'</font>', $str);
  5. }else{
  6. return '';
  7. }
  8. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.