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
mt_rand() fonksiyonunu rastgele bir sayı üretmek istediğimizde kullanırız. İsterseniz parametresiz kullanabilirsiniz, isterseniz de 2 parametre vererek sayının bu minimum ve maksimum değerler arasında üretilmesini sağlayabilirsiniz. mt_rand() fonksiyonunun parametresiz kullanımında üretilecek maksimum sayı değeri bazı işletim sistemlerinde (Windows) 2147483647 olarak tanımlıdır. mt_rand() fonksiyonu "Mersenne Twister" algoritmasını kullanarak rastgele sayılar üretir ve Mersenne Twister algoritması PHP'nin kendi fonksiyonu olan rand() fonksiyonundan 4 kat daha hızlı şekilde sayılar üretir.
Syntax
mt_rand();
mt_rand(min,max);
min: Üretilecek sayının alabileceği minimum değer. Varsayılan değer 0.
max: Üretilecek sayının alabileceği maksimum değer. Varsayılan değer mt_getrandmax() fonksiyonu ile öğrenilir. Bazı işletim sistemlerinde bu değer farklılık gösterir.
Not: mt_getrandmax() fonksiyonu mt_rand() fonksiyonu ile üretilebilecek maksimum sayı değerini gösterir.
Örnek Kod
<?php
echo mt_rand(); // 0 ile mt_getrandmax() arasında bir sayı: 661008893
echo mt_rand(10,100); // 10 ile 100 arasında bir sayı: 82
echo mt_rand(-5,10); // -5 ile 10 arasında bir sayı: 7
echo mt_getrandmax(); // mt_getrandmax() ile üretilebilecek maksimum sayı değeri: 2147483647
?>