PHP intval() weird results

前端 未结 5 1149
无人及你
无人及你 2020-12-20 06:26

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

5条回答
  •  眼角桃花
    2020-12-20 07:15

    The integer value of var on success, or 0 on failure. Empty arrays return 0, non-empty arrays return 1. (From php.net intval().)

    intval('abcdefg') will trigger an error and the function return with 0.

提交回复
热议问题