Jump to content

[SOLVED] Using current month as variable?


Skipjackrick

Recommended Posts

Ok, so I am still a beginner with php but I'd like to know if there is a better way to do this.  Currently, I am setting the following variables throughout my code.

 

<?php
$month=5;
$month_name=May;
$year=2009;
?>

 

Is there a way that this could be done automatically?  Each month I have to change the variables to the current month.  Its a freaking pain in the ass.  There has got to be a way to do this automatically.

Link to comment
https://forums.phpfreaks.com/topic/156878-solved-using-current-month-as-variable/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.