**************************************************
16. is_string
Bir değişkenin dizge olup olmadığını belirlemek için kullanılır.
PHP- Kodu
<?php
if (is_string("0011"))
echo "It's a string\n";
else
echo "It is not a string";
?>
**************************************************
17. preg_replace
Bir dizede kalıp eşleşmesi gerçekleştirmek için, eşleşmeyi belirli bir metinle değiştirin. Bu örnek,
$str’deki boşlukları kaldırır.
PHP- Kodu
<?php
$str = 'Hello sir';
$str = preg_replace('/\s\s+/', ' ', $str);
echo $str;
?>
**************************************************
18. file_get_contents
Karakter dizisindeki bir dosyayı okur.
PHP- Kodu
<?php
echo file_get_contents("file.txt");
?>
**************************************************
19. array_key_exists
Belirli bir anahtar için bir diziyi kontrol eder ve anahtar varsa doğru, anahtar yoksa
false döndürür.
PHP- Kodu
<?php
$car = array("Renault"=>"Kangoo", "Peugeot"=>"Crossover");
if (array_key_exists("Renault",$car))
{
echo "The key exists!";
}
else
{
echo "The key does not exist!";
}
?>
**************************************************
20. array_keys
Anahtarları içeren bir dizi döndürür.
PHP- Kodu
<?php
$car = array("Renault"=>"Kangoo", "Peugeot"=>"Crossover", "Toyota"=>"4X4");
print_r(array_keys($car));
?>
Çıktı:
PHP- Kodu
Array
(
[0] => Renault
[1] => Peugeot
[2] => Toyota
)