jump to navigation

Get a List of All Available PHP Functions on localhost May 25, 2011

Posted by Tournas Dimitrios in PHP.

This one’s actually pretty easy. Just create a new page on your web site with the following code inside it — when you visit said page, you’ll see a (fairly long) list of the PHP functions available to you. What’s more is that each function on the list will appear as a link to the function’s description and parameters (as found on PHP.net). Here’s the code:

$defined_functions = get_defined_functions();
$defined_int_funcs = $defined_functions["internal"];
print '<div style="font-family: Courier New;">';
        foreach ($defined_int_funcs as $sortk => $sortv) {
                $formatted = str_replace('_','-',$sortv);
                $function_link = '<a style="text-decoration: none;" href=';
                $function_link .= '"http://www.php.net/manual/en/function.';
                $function_link .= $formatted;
                $function_link .= '.php" target="_blank">';
                $function_link .= $sortv;
                $function_link .= "()</a><br/>\n";
                print $function_link;
print '</div>';

Happy PHP coding 🙂



No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s