search

Home  >  Q&A  >  body text

php 01==1?

php 01 ==1?

var_dump(in_array('01',array('1'))); // true

Can the boss explain it?

斜上方45度斜上方45度1258 days ago1218

reply all(2)I'll reply

  • Li_ [Xin]

    Li_ [Xin]2021-06-28 18:47:54

    01 == 1 Because if in_array does not add a third parameter to force the type, this is a weak type comparison. 01 is naturally equal to 1. If the force type is string 01 is not equal to string 1

    reply
    0
  • 猪老湿

    猪老湿2021-06-15 10:06:49

    What kind of function do you want to achieve?

    reply
    0
  • Cancelreply