note 45254 deleted from function.function-exists by betz

From: Date: Tue, 31 Aug 2004 14:36:23 +0000
Subject: note 45254 deleted from function.function-exists by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-75743@lists.php.net to get a copy of this message
Note Submitter: ericp at shepard dot com ---- <?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>'; ?>

« previous php.notes (#75743) next »