drbuowqe02101 2017-06-23 15:38
浏览 21
已采纳

如何检查变量是日期,字符串还是浮点数(数值)[PHP]

Hy guys, i have a problem.

My variable can have different values in my cycle:

  • values="10"
  • values="Hello"
  • values="2015-02-17"

How do I check the type of variable with a condition? I have tried but string type is "equal" to date type.

  • 写回答

3条回答 默认 最新

  • dongmiyu8979 2017-06-23 15:42
    关注

    You can try the php gettype() function to find the type

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?