Skip to content
Advertisement

How to know if a date/time string contain day or not in php?

I want to check if a date/time string contains a day or not.

I used the date_parse() function but it automatically adds day => 1 if it doesn’t find any day. So I couldn’t know if a string contains a day or not.

For example

JavaScript

How to know if this string contains a day or not?

Advertisement

Answer

I think you are expecting some thing like this.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement