Ver Mensaje Individual
  #6 (permalink)  
Antiguo 16/12/2013, 16:51
Avatar de jonni09lo
jonni09lo
Colaborador
 
Fecha de Ingreso: septiembre-2011
Ubicación: Estigia
Mensajes: 1.471
Antigüedad: 12 años, 8 meses
Puntos: 397
Respuesta: Espacios en campo TEXT

Me imagino que esto es lo que buscas

Código PHP:
Ver original
  1. function grabar_text($text) {
  2.  
  3.     $find = array(' ');
  4.     $repl = array('-');
  5.     $text = str_replace ($find, $repl, $text);
  6.     $text = trim($text, '-');
  7.     return $text;
  8. }
  9.    
  10. function mostrar_text($text) {
  11.     $find = array('-');
  12.     $repl = array(' ');
  13.     $text = str_replace ($find, $repl, $text);
  14.     $text = trim($text);
  15.     return $text;
  16. }

Saludos
__________________
Haz preguntas inteligentes-Como ser Hacker
No hacer preguntas por mensaje privado. No sólo no es inteligente sino que es egoísta.