Severity: 8192
Message: Return type of CI_Session_files_driver::open($save_path, $name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 113
Severity: 8192
Message: Return type of CI_Session_files_driver::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 280
Severity: 8192
Message: Return type of CI_Session_files_driver::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 145
Severity: 8192
Message: Return type of CI_Session_files_driver::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 223
Severity: 8192
Message: Return type of CI_Session_files_driver::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 303
Severity: 8192
Message: Return type of CI_Session_files_driver::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: drivers/Session_files_driver.php
Line Number: 344
Severity: 8192
Message: setcookie(): Passing null to parameter #7 ($httponly) of type bool is deprecated
Filename: core/Input.php
Line Number: 410
explode() fonksiyonu implode() fonksiyonunun tam tersidir. implode() fonksiyonunda dizideki elemanları birleştirip bir string elde ediyorduk, explode() fonksiyonunda ise stringi ayıraca göre bölüp her elemanını bir diziye atıyoruz. Genel olarak 3 parametre alır ancak çoğunlukla 2 parametre ile kullanılır.
Syntax
explode(separator,string,limit)
seperator: Zorunludur. Ayırıcı olarak kullanılır ve stringin nereden bölüneceğini belirler.
string: Zorunludur. Bölünecek stringdir.
limit: Opsiyoneldir. Bölme limitidir. Pozitif veya negatif değer alabilir. Pozitif değer stringin başından, negatif değer stringin sonundan sayar.
Not: explode() fonksiyonu orijinal stringi bozmaz.
Örnek 1)
<?php
$dizi = "explode() fonksiyonu örneğini inceliyorsunuz.";
$deger = explode(" ",$dizi); // Boşluğa göre stringi böler
print_r($deger); // Array ( [0] => explode() [1] => fonksiyonu [2] => örneğini [3] => inceliyorsunuz. )
echo $deger[0]; // explode()
echo $deger[1]; // fonksiyonu
echo $deger[2]; // örneğini
echo $deger[3]; // inceliyorsunuz
?>
Örnek 2)
<?php
$dizi = "bir,iki,üç,dört";
$deger = explode(",",$dizi); // Virgüle göre stringi böler
print_r($deger); // Array ( [0] => bir [1] => iki [2] => üç [3] => dört )
echo $deger[0]; // bir
echo $deger[1]; // iki
echo $deger[2]; // üç
echo $deger[3]; // dört
?>
Örnek 3)
<?php
$dizi = "bir,iki,üç,dört";
print_r(explode(",",$dizi,0)); // Array ( [0] => bir,iki,üç,dört )
print_r(explode(",",$dizi,2)); // Array ( [0] => bir [1] => iki,üç,dört )
print_r(explode(",",$dizi,-3)); // Array ( [0] => bir )
?>
YORUMLAR