Foros del Web » Soporte técnico » Ayuda General »

Warning: preg_replace() [function.preg-replace]: Unknown modifier '\' in /home/u12216

Estas en el tema de Warning: preg_replace() [function.preg-replace]: Unknown modifier '\' in /home/u12216 en el foro de Ayuda General en Foros del Web. ¿Me podrían ayudar? En el sistema de noticias de mi web, va bien insertar noticias, pero a la hora de leerlas... Me sale este error: ...
  #1 (permalink)  
Antiguo 20/07/2012, 02:41
 
Fecha de Ingreso: julio-2012
Mensajes: 3
Antigüedad: 11 años, 10 meses
Puntos: 0
Warning: preg_replace() [function.preg-replace]: Unknown modifier '\' in /home/u12216

¿Me podrían ayudar?
En el sistema de noticias de mi web, va bien insertar noticias, pero a la hora de leerlas...
Me sale este error:
Warning: preg_replace() [function.preg-replace]: Unknown modifier '\' in /home/u122160329/public_html/leer.php on line 38

leer.php:
<?php

function bbcode($text){
$a = array(
"/\[i\](.*?)\[\/i\]/is",
"/\[b\](.*?)\[\/b\]/is",
"/\[u\](.*?)\[\/u\]/is",
"/\[s\](.*?)\[\/s/\]/is",
"/\[center\](.*?)\[\/center\]/is",
"/\[align=left\](.*?)\[\/align\]/is",
"/\[align=right\](.*?)\[\/align\]/is",
"/\[img\](.*?)\[\/img\]/is",
"/\[img=(.*?)\]/is",
"/\[youtube\](.*?)\[\/youtube\]/is",
"/\(.*?)\[\/url\]/is",
"/\[url\](.*?)\[\/url\]/is",
"/\[quote\](.*?)\[\/quote\]/is",
"/\[code\](.*?)\[\/code\]/is"
);
$b = array(
"<i>$1</i>",
"<b>$1</b>",
"<u>$1</u>",
"<strike>$1</strike>",
"<p align=\"center\">$1</p>",
"<p align=\"left\">$1</p>",
"<p align=\"right\">$1</p>",
"<img src=\"$1\" />",
"<img src=\"$1\" />",
"<object width=\"425\" height=\"344\"><param name=\"movie\" value=\"$1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"$1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object>",

"<a href=\"$1\" target=\"_blank\">$2</a>",
"<a href=\"$1\" target=\"_blank\">$1</a>",
"<div class=\"textoCita\">Cita:\n<div class=\"cita\">$1</div></div>",
"<div class=\"textoCodigo\">C&oacute;digo:\n<div class=\"codigo\">$1</div></div>"
);
$text = str_replace("<br \>","\n",$text);
$text = preg_replace($a, $b, $text); (linea 38)
$text = str_replace("watch?v=","v/",$text);
return $text;
}
?>

<html>
<head>
<title>Leer noticia</title>
<link href="include/css.css" type="text/css" rel="stylesheet" />
</head>
<body>
<?php
//incluimos archivo de conexion
require("include/conexion.php");
if (isset($_GET['ID'])) {
$ID = $_GET['ID'];
//cogemos datos de la base
$select = mysql_query("select * from not_bn where ID = $ID order by ID desc", $conectar)or die("Fallo el select: ".mysql_error());
//los mostramos
while($not = mysql_fetch_array($select)){
//Mostramos el titulo de la noticia
echo "<h1 style=\"text-transform:uppercase;margin-bottom:2px;margin-top:0px;\">".$not['titulo']."</h1>";
//mostramos el contenido de la noticia
echo bbcode(nl2br(htmlspecialchars($not['noticia'])))."";
echo "<p>";
// la fecha y otros datos
echo "Enviado el ".$not['fecha']." a las ".$not['hora']."";
}
}else{
echo "Error!";
}
?>

Me sale este error:
Warning: preg_replace() [function.preg-replace]: Unknown modifier '\' in /home/u122160329/public_html/leer.php on line 38

Agradeceria mucho su ayuda.
  #2 (permalink)  
Antiguo 23/07/2012, 02:25
Avatar de hasdpk  
Fecha de Ingreso: agosto-2011
Ubicación: $spain->city( 'Arucas' );
Mensajes: 1.800
Antigüedad: 12 años, 8 meses
Puntos: 297
Respuesta: Warning: preg_replace() [function.preg-replace]: Unknown modifier '\' in /

¿Cuál es la linea 38? porque ahí tienes el problema.
__________________
Freelance Developer — www.rubenmartin.me PHP, SQL, Wordpress, Prestashop, Codeigniter, Laravel
RegaloConsolas — www.regaloconsolas.com Sorteo juegos, consolas y accesorios

Etiquetas: unknown, warning
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 12:33.