I am trying to make a select with the days of a month, but to know how many days there are going to be in the select I must know how many days the respective month has, the problem is that I do not know how to do it, I have already tried date('t', strtotime($fecha))
that it was a method that I saw , but it did not work, I hope you can help, thanks in advance.
this can help you
I also leave you 2 links
https://php.net/manual/en/function.cal-days-in-month.php
https://stackoverflow.com/questions/3691142/how-to-get-the-number-of-days-of-the-current-month-in-php
You get the data for the current month and year and then pass them as parameters to the function
cal_days_in_month(CAL_GREGORIAN, $mesActual, $anioActual);
Thank you very much for your help, I found a method that I would like to share with you
The parameters of this method would be like this
mktime($hora,$min,$seg,$mes,$dia,$anio)
Thanks to alluse the PHP date function
where 't' returns the number of days in the current month
In this blog there is an example of how to use it, I hope it works for you.
https://codigoroot.net/blog/obtener-fecha-y-hora-en-php-con-date/#parametrosDate