Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/06/2005, 11:50
Avatar de xknown
xknown
 
Fecha de Ingreso: diciembre-2004
Ubicación: Cusco - Perú
Mensajes: 2.248
Antigüedad: 19 años, 3 meses
Puntos: 7
En lugar de definir constantes deberías usar variables para hacer más fácil el reemplazo, probablemente el código debería ser así:
Código PHP:
$WEBSITE_TITLE 'Mi pagina web.com';
$PAGE_SECTION 'otro';
$result='<title>{WEBSITE_TITLE} {PAGE_SECTION}</title>';
$result=preg_replace("`\{([^\}]+)\}`ies""$$1",$result);
echo 
htmlentities($result); 
Actualización, también puedes hacerlo con constantes:
Código PHP:
define('WEBSITE_TITLE''Mi pagina web.com');
define('PAGE_SECTION''otro');
 
$result='<title>{WEBSITE_TITLE} {PAGE_SECTION}</title>';
 
$result=preg_replace("`\{([^\}]+)\}`ies""$1",$result);
 echo 
htmlentities($result); 
Saludos
__________________
Alex Concha
Buayacorp - Programación y Diseño

Última edición por xknown; 29/06/2005 a las 12:15