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] =&gt1
    
[1] =&gt4
    
[2] =&gt9
    
[3] =&gt16

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

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


________________

06/02/2023 İnsan olan herkesin kalbi acıdı.