Can the following code return "true" or "false"?
<code>$time<=date("Y-m-d-H-i-s")</code>
I compiled a code for sending text messages, which is used to retrieve the database. If the scheduled sending time is earlier than the current time, the text message will be sent.
If the above code does not work, please recommend a method, thank you!
(Beginners, the questions may be a bit idiotic, please answer patiently, thank you)
Can the following code return "true" or "false"?
<code>$time<=date("Y-m-d-H-i-s")</code>
I compiled a code for sending text messages, which is used to retrieve the database. If the scheduled sending time is earlier than the current time, the text message will be sent.
If the above code does not work, please recommend a method, thank you!
(Beginners, the questions may be a bit idiotic, please answer patiently, thank you)
//可以,不过可以用strtotime转化比较 >>> $time=date('Y-m-d H:i:s') => "2016-06-10 13:39:38" >>> $time >='2016-06-09 11:11:11' => true >>> $time>='2016-06-19 11:11:11' => false >>> strtotime($time)>=strtotime('2016-06-19 11:11:11') => false
Can strings be compared in size? . .
strottime()
Okay
Shouldn’t it be a timestamp comparison