Tekil Mesaj gösterimi
Alt 03 Ağustos 2021, 23:11   #5
ExCaLuBuR
✓
ExCaLuBuR - ait Kullanıcı Resmi (Avatar)

Standart

**************************************************

21. dirname

Belirli bir yol için dizinin adını döndürür.

PHP- Kodu

<?php
     
echo dirname("/path/script.php");
?&
gt; 

**************************************************

22. function_exists

PHP betiğinde bir işlev olup olmadığını kontrol eder.

PHP- Kodu

<?php
   
function displayMsg()
   {
        echo 
"Welcome to Code4Example";
   }
  
   
// Checks if the function named displayMsg exists or not
   
if (function_exists ('displayMsg'))
   {
        echo 
"The displayMsg () function exists.\n";
   }
   else
   {
        echo 
"The displayMsg () function does not exist.\n";
   }
?&
gt; 

**************************************************

23. array_map

Bir dizinin her bir değerini kullanıcı tanımlı bir işleve gönderir ve kullanıcı tanımlı işlev tarafından sağlanan yeni değerlerle bir dizi döndürür.

PHP- Kodu

<?php
   
function multiplication($n)
   {
     return(
$n * $n);
   }

   
$tab = array(1,2,3,4);
   
print_r(array_map("multiplication", $tab));
?&
gt; 

Çıktı:

PHP- Kodu

Array
(
    [
0] => 1
    
[1] => 4
    
[2] => 9
    
[3] => 16
) 

**************************************************

24. get_class

Bu işlev, verilen nesnenin sınıf adını alır.

PHP- Kodu

<?php
   
// create an object
   
$obj = new Foo();
   
// get the class name
   
echo get_class($obj);
?&
gt; 

**************************************************

25. class_exists

Bu işlev, verilen sınıfın tanımlanıp tanımlanmadığını kontrol eder.

PHP- Kodu

<?php
   
if (class_exists('Foo')) {
         
$obj = new Foo();
   }
?&
gt; 


________________

🚀 TemaDepo ✦ Premium WordPress Temaları ✦ Canlı Demo Sistemi ✦ SEO & Kurulum Hizmetleri ✦ [Üye Olmadan Linkleri Göremezsiniz. Lütfen Üye Olmak için TIKLAYIN...]