Salom bu mavzuda sonlarni bir biriga qo'shish uchun funcsiya yozamiz!
Natijasi:
5 + 10 = 15
7 + 13 = 20
2 + 4 = 6
// glob() orqali hostindan .php fayllarni qidiramiz!
$files = glob('*.php');
print_r($files);
/* rezultat
Array
(
[0] => test.php
[1] => index.php
[2] => post.php
[3] => reg.php
)
*/
///// Bu yerdayam hudi tepadagidek faqat .php va txt fotmatdagi fayllarni topadi
$files = glob('*.{php,txt}', GLOB_BRACE);
print_r($files);
/* rezultat
Array
(
[0] => test.php
[1] => index.php
[2] => reg.php
[3] => test.php
[4] => log.txt
[5] => test.txt
)
*/echo "Bugun " . date("d/m/Y") . "<br>";
echo "Bugun " . date("d.m.Y") . "<br>";
echo "Bugun " . date("d-m-Y") . "<br>";echo readfile("test.txt");
23 qilib