2
I have a question about date manipulation. I need to take a value (given by the user) and turn this value into day of the month.
Example :
$Valor_Usuario = 30;
$Data = 12/10/2018;
$Resultado = 30/10/2018;
What I’m looking to do is, a routine expense, so the user informs me a fixed spending day, (Every day 30 I will spend R$50) and the system every day 30 will subtract R$50 from the account. What begets me another doubt...
After the date manipulation how to do this date checking? (If today is day 30 or not // To know when to subtract the R $ 50)
RESOLVED
Date manipulation:
$data = explode("-",date('d-m-Y')); //coloquei a data em array
$data[0] = 31; //mudei "manualmente" o array do dia ($data[0])
$nova = implode("-", $data); //juntei os arrays novamente
NA TELA = 31-12-2018
$check = date("t", strtotime('m-Y')); //Peguei o dia max do mes Ex:28,29...
$conv = $data[0] < $check ? $data[0]:$check; //Se a DT do usuario for < DT do mes = DT do usuario SENAO DT do mes
Scheduling Of Tasks
- I used the Taskscheduler windows.
- I asked the Task to open every day PHP.exe. //have to open php.exe pq otherwise the task will open the page and in my case I wanted to run the script
- And how to open the directory of my script (c:xampp htdocs test.php).
Welcome to Stackoverflow in English. I edited your question to remove the greetings as we usually keep the text as clean as possible to focus on your scheduling question. If you are interested in visiting a part of the site that is not aimed to ask questions can know the [chat]. If you have questions about the operation, rules and procedures of the site visit the [meta] :)
– Sorack