Comparison Operators >= in Control Structures why false? |
(04-07-2019, 08:43 AM)skunkbad Wrote: PHP has no way of knowing that your dates are dates. There are a number of ways you could handle it, but the simplest would be to wrap your dates in strtotime() You are exactly right, in the top when defining the date it is the string and when we compare any string resultant will be true always. In only case if it is integer or date in right format then we can compare.
.NET and CodeIgniter Software Engineer
|
Messages In This Thread |
Comparison Operators >= in Control Structures why false? - by DELE - 04-07-2019, 12:05 AM
RE: Comparison Operators >= in Control Structures why false? - by jreklund - 04-07-2019, 01:20 AM
RE: Comparison Operators >= in Control Structures why false? - by Paradinight - 04-07-2019, 03:29 AM
RE: Comparison Operators >= in Control Structures why false? - by skunkbad - 04-07-2019, 08:43 AM
RE: Comparison Operators >= in Control Structures why false? - by DELE - 04-09-2019, 09:42 PM
RE: Comparison Operators >= in Control Structures why false? - by MrJunaidShahid - 04-10-2019, 01:41 PM
RE: Comparison Operators >= in Control Structures why false? - by InsiteFX - 04-07-2019, 03:08 PM
|