I'm trying to do a date filter, the issue is like this:
By method POST
I get a date with the format "yyy-mm-dd"
plus the time with format "HH:MM:SS"
, the date and time are separate variables of type string.
$fecha = "2016-08-29";
$hora = "13:00:00";
Based on that date and time, I want to filter according to the following requirement:
"Show a form only on Monday through Friday from 07:00 a.m. to 10:00 p.m. and Saturdays from 10:00 a.m. to 2:00 p.m.".
For example: The variable $fecha
y $hora
is set to the request, so it should display some information, a form.
I am trying with some methods PHP
like date()
, time()
, however I am not able to solve the problem.
If you have any ideas or recommendations I would greatly appreciate it.
Given the strings
A first algorithm that complies with this statement:
We would be:
It should work... then you implement the form as you see fit. If you are programming behind a web server, you remove the command line arguments and replace them with get or post variables or however you send them.
I hope I understood you.