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
trim() fonksiyonu stringin başındaki ve sonundaki boşlukları veya silinmesini istediğiniz karakterleri siler. Genellikle kullanıcının üye olurken, bilgilerinin başına veya sonuna yanlışlıkla eklenen boşluk karakterini temizlemek amacıyla kullanılır. Yalnız bilinenin aksine trim() fonksiyonu sadece boşluk karakterinin silinmesi için kullanılmaz, stringin başındaki ve sonundaki istediğiniz karakterleri silmek için de kullanabilirsiniz. ltrim() fonksiyonu (Left = Sol, left trim = ltrim) stringin başındaki boşluğu siler, rtrim() (Right = Sağ, right trim = rtrim) fonksiyonu ise stringin sonundaki boşluğu siler. Bütün fonksiyonların 2 parametreli ve 1 parametreli kullanımları vardır.
Syntax
trim(string)
trim(string,charlist)
ltrim(string)
ltrim(string,charlist)
rtrim(string)
rtrim(string,charlist)
string: Herhangi bir string olabilir.
charlist: Silinmesini istediğiniz karakterler.
Not: trim(string), ltrim(string) vertrim(string) kullanımında sadece aşağıdaki karakterler silinir.
Örnek 1)
<?php
$cumle = " Zamazingo ";
echo trim($cumle);
// Çıktı: "Zamazingo"
?>
Örnek 2)
<?php
$cumle = " \t Zamazingo \n\r";
echo trim($cumle);
// Çıktı: "Zamazingo"
?>
Örnek 3)
<?php
$cumle = "Karakter örneği!";
echo trim($cumle, "Kaeğö!");
// Çıktı: "rakter örneği"
?>
Örnek 4)
<?php
$cumle = " Karakter örneği! \n ";
echo ltrim($cumle, "!") . "<br>";
// Çıktı: "Karakter örneği! "
?>
Örnek 5)
<?php
$cumle = " Karakter örneği! \n ";
echo rtrim($cumle) . "<br>";
// Çıktı: " Karakter örneği!"
?>