stristr
Versione insensibile alle maiuscole/minuscole di
Descrizione
Restituisce il contenuto di haystack dalla prima occorrenza di needle fino alla fine. needle e haystack sono esaminati senza distinguere tra lettere maiuscole e minuscole.
Se needle non viene trovato, la funzione restituisce false.
Se needle non รจ una stringa, viene convertito in un intero e si utilizza il valore ordinale del carattere.
Esempio di uso di stristr <?php $email = 'USER@EXAMPLE.com'; echo stristr($email, 'e'); // outputs ER@EXAMPLE.com ?>
Verifica se una stringa esiste o meno <?php $string = 'Hello World!'; if(stristr($string, 'earth') === FALSE) { echo '"earth" not found in string'; } // outputs: "earth" not found in string ?>
Utilizzo di un dato non stringa da cercare <?php $string = 'APPLE'; echo stristr($string, 97); // 97 = lowercase a // outputs: APPLE ?>
Vedere anche strstr, strrchr, substr e ereg.