Ver Mensaje Individual
  #2 (permalink)  
Antiguo 21/11/2010, 17:52
pochos
 
Fecha de Ingreso: julio-2009
Mensajes: 72
Antigüedad: 14 años, 9 meses
Puntos: 16
Respuesta: Problema con try catch

no se que intentas hacer pero a ver si esto te ayuda

Código PHP:
function llamarFuncion($nombreFuncion){

       if(!
function_exists($nombreFuncion)){

           throw new 
Exception('Error, esa funcion no existe');
       } else {
           return 
$nombreFuncion();
       }

}

try{
      
llamarFuncion('unafuncion');
}catch(
Exception $e){
       echo 
$e->getMessage();