Mi sembra ovvio. Se leggeste i manuali:
codice:Return Values Returns the position of where the needle exists relative to the beginning of the haystack string (independent of offset). Also note that string positions start at 0, and not 1. Returns FALSE if the needle was not found.
La funzione strpos() restituisce la posizione in cui viene trovara la sottostringa per cui mettendo tale risultato in una condizione if se ne fa un utilizzo errato dato che, quando la sottostringa inizia alla posizione 0 (zero) PHP interpreta tale valore come FALSE aspettandosi giustamente all'interno di una condizione if un valore booleano.

Rispondi quotando