title: Is there a better way to write this name conversion function in php?
body: <p>Persian day names are different than English, and also week starts Saturday. So I have this weekday name and number conversion function:</p>
  
  <pre><code>function getDayNames($day, $shorten = false, $len = 1, $numeric = false)
  {
      $ret = '';
      switch ( strtolower($day) ) {
          case 'sat': case 'saturday':  $ret = 'شنبه'; $n = 1; break;
          case 'sun': case 'sunday':    $ret = 'یکشنبه'; $n = 2; break;
          case 'mon': case 'monday':    $ret = 'دوشنبه'; $n = 3; break;
          case 'tue': case 'tuesday':   $ret = 'سه شنبه'; $n = 4; break;
          case 'wed': case 'wednesday': $ret = 'چهارشنبه'; $n = 5; break;
          case 'thu': case 'thursday':  $ret = 'پنجشنبه'; $n = 6; break;
          case 'fri': case 'friday':    $ret = 'جمعه'; $n = 7; break;
      }
      return ($numeric) ? $n : (($shorten) ? substr($ret, 0, $len) : $ret);
  }
  </code></pre>
  
  <p>and I wanna know if there is a better way to rewrite this. Using <code>switch</code> is not ideal.</p>
  
  <p>Thanks in advance.</p>