Ver Mensaje Individual
  #10 (permalink)  
Antiguo 20/02/2008, 11:44
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 20 años, 4 meses
Puntos: 2135
Re: Registrar palabra entre caracteres conocidos

Ya te di las opciones debes de usar substr y strpos para obtener las partes, un ejemplo:
Código PHP:
function textoentrecadenas( $cad1, $cad2, $texto ) {
         
$pos1 = stripos( $texto, $cad1 ); // Buscamos el primer string
         
         
if( $pos1 === false ) { // Si la posicion 1 no existe regresamos vacio
                  
return "";
         }
         
         
$pos2 = stripos( $texto, $cad2, $pos1 ); // Buscamos el segundo
         
         
if( $pos2 === false ) { // Si no esta asumimos al final del string
               
$pos2 = strlen( $texto );
         }

          return 
substr( $texto, $pos1, ( strlen( $texto ) - $pos2 ) ); // Regresamos lo que hay entre el $pos1 y $pos2
} 
Saludos.