Ver Mensaje Individual
  #9 (permalink)  
Antiguo 06/05/2013, 08:57
Avatar de danistrein
danistrein
 
Fecha de Ingreso: septiembre-2008
Ubicación: Salta Capital
Mensajes: 550
Antigüedad: 15 años, 7 meses
Puntos: 9
Respuesta: como hacer esto con preg_match

he intentado de esta manera
Código PHP:
Ver original
  1. function sacar($fuente,$izq,$der){
  2.     $izq = preg_quote($izq,'\\');
  3.     $der = preg_quote($der,'\\');
  4.     preg_match_all($izq."(.+)".$der, $fuente, $salida);
  5.     return $salida;
  6. }
Cita:
Warning: preg_match_all() [function.preg-match-all]: Delimiter must not be alphanumeric or backslash in C:\AppServ\www\Anime\3.php on line 16
NULL
y probando asi
Código PHP:
Ver original
  1. function sacar($fuente,$izq,$der){
  2.     $izq = preg_quote($izq,'\\');
  3.     $der = preg_quote($der,'\\');
  4.     preg_match_all("/".$izq."(.+)".$der."/", $fuente, $salida);
  5.     return $salida;
  6. }
Cita:
Warning: preg_match_all() [function.preg-match-all]: Unknown modifier 'a' in C:\AppServ\www\Anime\3.php on line 16
NULL
daaah me rompe la cabeza no poder solucionarlo
__________________
Appones.net - www.appones.net