From e3e8c188c9e38af43be6ece36078d95da00f7583 Mon Sep 17 00:00:00 2001 From: Markus Fischer Date: Sun, 5 May 2002 16:55:17 +0000 Subject: [PATCH] - Add example. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@81290 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/info/functions/dl.xml | 24 +++++++++++++------ reference/info/functions/extension-loaded.xml | 15 ++++++++++-- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/reference/info/functions/dl.xml b/reference/info/functions/dl.xml index d9047611ba..ad1f5cdd49 100644 --- a/reference/info/functions/dl.xml +++ b/reference/info/functions/dl.xml @@ -1,5 +1,5 @@ - + @@ -31,9 +31,23 @@ specified library couldn't be loaded, in addition to &false; an E_WARNING message is emitted. + + Use extension_loaded to test whether a given + extension is already available or not. + + + Example: + +if (!extension_loaded('gd')) { + if (!dl('gd.so')) { + exit; + } +} + + The directory where the extension is loaded from depends on your - platform, too: + platform: Windows - If not explicitly set in the PHP.INI, @@ -82,13 +96,9 @@ - dl is case sensitive on unix platforms. + dl is case sensitive on unix platforms. - - Use extension_loaded to test whether a given - extension is already available or not. - See also Extension Loading Directives diff --git a/reference/info/functions/extension-loaded.xml b/reference/info/functions/extension-loaded.xml index b0c6ddb7f3..7a7afea378 100644 --- a/reference/info/functions/extension-loaded.xml +++ b/reference/info/functions/extension-loaded.xml @@ -1,5 +1,5 @@ - + @@ -16,6 +16,16 @@ Returns &true; if the extension identified by name is loaded, &false; otherwise. + + Example: + +if (!extension_loaded('gd')) { + if (!dl('gd.so')) { + exit; + } +} + + You can see the names of various extensions by using phpinfo or if you're usnig the @@ -54,7 +64,8 @@ ctype - See also phpinfo. + See also phpinfo and + dl.