How to handle function calls in php

Asked

Viewed 36 times

1

I have with problem related functions in php, Basically the user can try to access a function inside php dynamically, if the function exite it is executed, more if it does not succeed it returns Uncaught Error: Call to Undefined i was wondering how to check if the function does not exist using php to display a custom msg type 'The function does not exist'

1 answer

2


Of course, Voce can validate that a function exists.

You can use that:

<?php
  //O parâmetro é o nome da sua função:
  if (function_exists('imap_open')) {
   echo "Las funciones de IMAP están disponibles.<br />\n";
  } else {
   echo "Las funciones de IMAP no están disponibles.<br />\n";
  }
?>

Source: http://php.net/manual/en/function.function-exists.php.

  • Bgd, had sought more had not found this publication.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.