Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
Ordenar la visualización de datos de los últimos 30 días con foreach PHP

Ordenaré la visualización de datos de los últimos 30 días con foreach con PHP.

Este es mi código:

 for($i = 0; $i < 30; $i++) { echo date("Ymd", strtotime('-'. $i .' days')).'<br>'; }

este es el resultado:

 2021-10-07 2021-10-06 2021-10-05 2021-10-04 2021-10-03 2021-10-02 2021-10-01 2021-09-30 2021-09-29 2021-09-28 2021-09-27 2021-09-26 2021-09-25 2021-09-24 2021-09-23 2021-09-22 2021-09-21 2021-09-20 2021-09-19 2021-09-18 2021-09-17 2021-09-16 2021-09-15 2021-09-14 2021-09-13 2021-09-12 2021-09-11 2021-09-10 2021-09-09 2021-09-08

Luego quiero ordenar los datos desde la fecha más antigua hasta la nueva fecha. Del 2021-09-08 al 2021-10-07 .

como se hace, hay alguna otra solucion?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Mira esto

 for($i = 30; $i >= 0; $i--) { echo date("Ymd", strtotime('-'. $i .' days')).'<br>'; }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!