sábado, 19 de marzo de 2016

replacing all spaces by * character

<?php



$text="  hola amigo         ";
 $text = preg_replace('/\s+/','*',$text);

echo  $text;


ouput
*hola*amigo*

No hay comentarios:

Publicar un comentario