Posted By

nicolaspar on 07/12/06


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

neverwolf
willcodeforfood


Pintar un texto (highlight)


 / Published in: PHP
 

  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  

You need to login to post a comment.