title: How do I get French month names in PHP in this existing script?
body: <p>I use the following code below to create a select dropdown of the next 12 months, starting with this month:</p>
  
  <pre><code>$year=date("Y");
  //Current Month
  $month = date('m');
  $dateObj   = DateTime::createFromFormat('!m', $month);
  $month0 = $dateObj-&gt;format('F'); 
  $monthHTML .= "&lt;option value='$month/$year'&gt;$month0 $year&lt;/option&gt;";
  //next 11 months
  for ($i=1; $i&lt;=11; $i++) {
      $month = date('m', strtotime('first day of +'.$i.' month'));
          if($month==01) {
              $year++;
          }
      $dateObj   = DateTime::createFromFormat('!m', $month);
      ${"month".$i} = $dateObj-&gt;format('F'); 
      $monthHTML .= "&lt;option value='$month/$year'&gt;".${"month".$i}." $year&lt;/option&gt;";
  }
  </code></pre>
  
  <p>that creates output like this:</p>
  
  <pre><code>&lt;select id="default-calendar-month" name="default-month"&gt;
              &lt;option value='01/2018'&gt;January 2018&lt;/option&gt;&lt;option value='02/2018'&gt;February 2018&lt;/option&gt;&lt;option value='03/2018'&gt;March 2018&lt;/option&gt;&lt;option value='04/2018'&gt;April 2018&lt;/option&gt;&lt;option value='05/2018'&gt;May 2018&lt;/option&gt;&lt;option value='06/2018'&gt;June 2018&lt;/option&gt;&lt;option value='07/2018'&gt;July 2018&lt;/option&gt;&lt;option value='08/2018'&gt;August 2018&lt;/option&gt;&lt;option value='09/2018'&gt;September 2018&lt;/option&gt;&lt;option value='10/2018'&gt;October 2018&lt;/option&gt;&lt;option value='11/2018'&gt;November 2018&lt;/option&gt;&lt;option value='12/2018'&gt;December 2018&lt;/option&gt;&lt;/select&gt;
  </code></pre>
  
  <p>I'd like to use the same code to get the list in French, i.e. like...</p>
  
  <pre><code>&lt;select id="default-calendar-month" name="default-month"&gt;
              &lt;option value='01/2018'&gt;Janvier 2018&lt;/option&gt;&lt;option value='02/2018'&gt;Fevrier 2018&lt;/option&gt;
  </code></pre>
  
  <p>And so on.</p>
  
  <p>Looking at other answers (like <a href="https://stackoverflow.com/questions/7309960/change-month-name-to-french">this</a>), I tried adding:</p>
  
  <pre><code>setlocale(LC_TIME, "fr_FR");
  </code></pre>
  
  <p>And changing "strtotime" to "strftime" but that kicks these two errors.  What am I doing wrong?</p>
  
  <pre><code>Warning: date() expects parameter 2 to be long, string given in /home/mysite/public_html/add.php on line 31
  
  Fatal error: Call to a member function format() on a non-object in /home/mysite/public_html/add.php on line 36
  </code></pre>