Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > PHP
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #9  
Antiguo 14-04-2008
Avatar de Caral
[Caral] Caral is offline
Miembro Premium
 
Registrado: ago 2006
Posts: 7.659
Poder: 28
Caral Va por buen camino
Hola
De php no se pero me parece que esta funcion reemplaza:
Código PHP:
Some muddling through docs and many obscenties later, I produced the following, which expands escape sequences in an existing string with NO interpolation.

<?php

// where we do all our magic
function expand_escape($string) {
    return 
preg_replace_callback(
        
'/\\\([nrtvf]|[0-7]{1,3}|[0-9A-Fa-f]{1,2})?/',
        
create_function(
            
'$matches',
            
'return ($matches[0] == "\\\\") ? "" : eval( sprintf(\'return "%s";\', $matches[0]) );'
        
),
        
$string
    
);
}

// a string to test, and show the before and after
$before 'Quantity:\t500\nPrice:\t$5.25 each';
$after expand_escape($before);
var_dump($before$after);

/* Outputs:
string(34) "Quantity:\t500\nPrice:\t$5.25 each"
string(31) "Quantity:    500
Price:    $5.25 each"
*/

?>
Saludos
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Ayuda con expresiones regulares Lerak Varios 1 13-04-2008 01:05:41
Buscador de código que soporta expresiones regulares Al González Noticias 4 04-11-2007 18:17:29
Expresiones Regulares (¿o Regular Expressions?) Ñuño Martínez Varios 12 13-10-2006 22:36:40
expresiones regulares en sql jonmendi SQL 1 24-12-2004 15:28:39
Expresiones regulares roman Varios 1 18-08-2003 17:08:37


La franja horaria es GMT +2. Ahora son las 20:49:43.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi