**************************************************
31. is_numeric
Bir değişkenin sayısal olup olmadığını kontrol etmek için kullanılır.
PHP- Kodu
<?php
$var = 678;
if (is_numeric($var))
{
echo "$var is a numeric value." ;
}
else
{
echo "$var is not a numeric value." ;
}
?>
**************************************************
32. array_shift
Bir diziden ilk öğeyi kaldırır ve silinen öğenin değerini döndürür.
PHP- Kodu
<?php
$colors = array(0=>"orange", 1=>"green", 2=>"blue");
echo array_shift($colors);
print_r ($colors);
?>
**************************************************
33. defined
Sabit olup olmadığını kontrol eder.
PHP- Kodu
<?php
define("PI", 3.14);
echo defined("PI");
?>
**************************************************
34. is_dir
Belirtilen dosyanın bir dizin olup olmadığını kontrol eder.
PHP- Kodu
<?php
$directory = "documents";
if(is_dir($directory))
{
echo ("$directory is a directory");
}
else
{
echo ("$directory is not a directory");
}
?>
**************************************************
35. json_decode
JSON dizesinin kodunu çözer
PHP- Kodu
<?php
$json = '{"a":1,"b":2,"c":3}';
var_dump(json_decode($json));
?>