array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.function-exists.php', 1 => 'function_exists', ), 'up' => array ( 0 => 'ref.funchand.php', 1 => 'İşlevlerle İlgili İşlevler', ), 'prev' => array ( 0 => 'function.func-num-args.php', 1 => 'func_num_args', ), 'next' => array ( 0 => 'function.get-defined-functions.php', 1 => 'get_defined_functions', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'tr', 'path' => 'reference/funchand/functions/function-exists.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
function_exists — Eğer işlev tanımlanmış ise true
döndürür
işlev
hem dahili (yerleşik) hem de kullanıcı
tanımlı işlevlerin listesinde aranır.
işlev
Bir dizge olarak işlevin ismi.
Eğer işlev
mevcut ve bir işlevin ismi ise
true
döndürür, aksi takdirde false
döndürür.
Bilginize:
include_once ve echo gibi oluşumlar için bu işlev
false
döndürür.
Örnek 1 - function_exists() örneği
<?php
if (function_exists('imap_open')) {
echo "IMAP işlevleri mevcut.<br />\n";
} else {
echo "IMAP işlevleri mevcut değil.<br />\n";
}
?>
Bilginize:
Yapılandırma ve derleme seçeneklerinden dolayı işlev kullanılabilir olmasa bile işlevin ismi mevcut olabilir (görüntü işlevleri buna iyi bir örnektir.)