Posted By

luman on 08/03/06


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

meth
willcodeforfood


Nombre a Iniciales


 / Published in: PHP
 

  1. function iniciales($nombre) {
  2. $notocar = Array('del','de');
  3. $trozos = explode(' ',$nombre);
  4. $iniciales = '';
  5. for($i=0;$i<count($trozos);$i++){
  6. if(in_array($trozos[$i],$notocar)) $iniciales .= $trozos[$i]." ";
  7. else $iniciales .= substr($trozos[$i],0,1).". ";
  8. }
  9. return $iniciales;
  10. }

Report this snippet  

You need to login to post a comment.