I\'m encountering something weird and I don\'t know why it is happening!
I have a URL like:
http://mysite.com/users/USER_ID
this user id
PHP is a little odd when it comes to types.
Basically, what you are doing is parsing the string into a number (so 'abcdef' returns 0 because it isn't a number at all), then comparing the original string to the number.
Now, I can see why you would assume that it should be false, but PHP tries to be clever. Basically, == will coerce types, and almost always coerces to numbers if one of it's values is a number. So it is using the same conversion that you did on the string, then comparing.
It is a better idea to use === which also checks types.