I am creating a login and want to allow my users to login either by username or email. How would I check if a string contains a letter, in this case @ so I can handle it correctly. Would I use strstr or strpos? Thanks!
To just check if string contains a letter you could use
if (strpos($source_string, $letter) !== false) { ... }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With