note 45254 added to function.function-exists
| From: | ericpatsheparddotcom at osu1 dot php dot net | Date: | Tue, 31 Aug 2004 11:41:56 +0000 |
| Subject: | note 45254 added to function.function-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-75736@lists.php.net to get a copy of this message | ||
<?php
# Dynamic Web Form Fuction Check
// A simple script to check for functions on the fly.
// By ericp at shepard dot com 2004-08
// No warranties or licenses expressed or implied. Use at your own risk.
// Copy this script to a file like functioncheck.php.
// Example usage: functioncheck.php?functions=mail,md5,curl_init
// Shows a simple table with yes|no answers.
# No modifications needed
if ( !$functions ) {
// Display random functions, if no web request.
$functions = 'mcrypt_decrypt,sqlite_open,curl_init,md5,mail,fake_function';
}
$functions_array = explode( ',', $functions );
sort ( $functions_array ) ;
echo '<table border=1>';
echo '<tr><td
nowrap><b>Function</b></td><td><b>Available?</b></td></tr>';
if (count($functions_array)>0) {
for ($i=0;$i<count($functions_array);$i++) {
$func = trim($functions_array[$i]);
if (function_exists($func)) {
echo '<tr><td nowrap>' . $func .
'</td><td>yes</td></tr>';
}else{
echo '<tr><td nowrap>' . $func .
'</td><td>no</td></tr>';
}
}
}
echo '</table>';
?>
----
Manual Page -- http://www.php.net/manual/en/function.function-exists.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45254
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45254&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45254&report=yes
Search -- http://master.php.net/manage/user-notes.php