
17/06/2011, 22:32
|
 | | | Fecha de Ingreso: febrero-2010 Ubicación: /home/user
Mensajes: 1.341
Antigüedad: 15 años Puntos: 177 | |
Respuesta: como separar una cadena ? Cita:
Iniciado por abimaelrc Aquí propongo el mio
Código PHP:
Ver original<?php function addSeparator($string, $separator = ';') { : false; } $str = ''; var_dump(addSeparator ($str)); // imprime bool(false) $str = 'foo123bar456baz7candy89'; var_dump(addSeparator ($str)); // imprime string(30) "foo;123;bar;456;baz;7;candy;89" $str = 'foo123bar456baz7candy89'; var_dump(addSeparator ($str, '-')); // imprime string(30) "foo-123-bar-456-baz-7-candy-89"
IMPRESIONANTE !!!   
__________________ la la la |