Consult two days in php

Asked

Viewed 28 times

-3

I’m wanting to think of a way to make the consultation two days repeated in the month.

The days are 15 and 30, I would like to make an IF on those dates where will return me a value. In case this consultation would be monthly and then I did so $evento = date("15/m/y"); $evento1 = date("30/m/y"); I’ve hit my head I can’t think of a way to do that.

The query will be done via crontab, I just need to return the value to insert in the cron code.

1 answer

1

If understood correctly, you could do the following, in php code put

    $evento = date("d/m/Y")

to get the same system date and the crontab your server puts to run on days 15 and 30 like this:

   0 0 15 * * /usr/bin/php /var/www/html/consulta.php
   0 0 30* * /usr/bin/php /var/www/html/consulta.php

I hope I’ve helped...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.