Skip to content

关于challenge-2 #4

@MasonQAQ

Description

@MasonQAQ

看了你给出的solution,你已经解释了is_numeric()函数和(int)xxx强转的区别,但是能解释下:

1、$_GET['time'] < 60 * 60 * 24 * 30 * 2
2、(int)$_GET['time']

这两种的区别吗?因为本题过is_numeric容易,但是后面涉及到字符串和整数比较大小时候,按照php的说法,字符串会转化为integer,为什么在进行数值比较时候的类型转化和通过(int)强转的类型转化结果不一致?而且此题貌似在不同环境其解法不一样。忘解惑。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions