Skip to content

Instantly share code, notes, and snippets.

@jamalnasir
Last active April 29, 2018 07:16
Show Gist options
  • Save jamalnasir/988d2f26c2aec55cbe8b5c0238b6cbde to your computer and use it in GitHub Desktop.
Save jamalnasir/988d2f26c2aec55cbe8b5c0238b6cbde to your computer and use it in GitHub Desktop.
Printing Months and Years
<?php
$years = [];
$months = [];
foreach(range(Carbon::now()->year - 100, Carbon::now()->year, 1) as $year){array_push($years, $year);}
foreach(range(2, 12) as $key=>$month){array_push($months, date('F', mktime(0,0,0,$month)));}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment