How to check if a string is one of the known values?

前端 未结 4 2014
长发绾君心
长发绾君心 2020-12-03 14:49

Suppose I have the code above, how to write th

4条回答
  •  渐次进展
    2020-12-03 15:49

    Use the in_array() function.

    Manual says:

    Searches haystack for needle using loose comparison unless strict is set.

    Example:

    
    

提交回复
热议问题