I need using php to give out the date of tomorrow in the format yyyy-mm-dd I googled and found this expression <?php $tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); ?> <?php $tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); ?> it is of course the wrong format, but it does not work, an error is issued

syntax error unexpected t_string, expecting , or )

Screenshot code:

enter image description here

  • cannot be played, there is no error in the above code snippet - teran
  • @teran here look at cloud.mail.ru/public/9z32/ubFynAzSm - Arcadiy
  • @Arcadiy there is not at all a mistake. Quotes correctly arrange. and in such matters the code should be published in the question itself, not in the image - Alex
  • @Alex you are right. Please make a reply. - Arcadiy

2 answers 2

The error is not in this, judging by the screenshot, an error in incorrectly placed quotes.

  • one
    Thank you very much - Arcadiy

There are no errors in the code snippet you brought.

Here is another implementation:

 $date = new DateTime(); $date ->add(new DateInterval('P1D')); $tomorrow= $date->format('Ym-d') ; echo $tomorrow; 
  • And how do I insert this code in this line instead of asterisks curl_setopt ($ ch, CURLOPT_URL, "api.travelpayouts.com/v1/prices/direct?currency=RUB&origin=MOW&destination=AER&depart_date=**********"); - Arcadiy
  • curl_setopt ($ ch, CURLOPT_URL, "api.travelpayouts.com/v1/prices/direct?currency=RUB&origin=โ€Œ MOW & destination = AER & โ€Œ depart_date =". $ tomorrow); This is instead echo $ tomorrow; - Anton Skorodumov