title: What is so good about gettext for language files?
body: <p>Everywhere on SO when it comes to making a multi language app in PHP everyone say that <a href="http://php.net/manual/en/intro.gettext.php" rel="noreferrer">gettext</a> is the best way to do it.  I am just wanting to know why?  </p>
  
  <p>Like what makes this method below, less efficient then using gettext?</p>
  
  <pre><code>&lt;?PHP
  //Have seperate language files for each language I add, this would be english file
  function lang($phrase){
      static $lang = array(
          'NO_PHOTO' =&gt; 'No photo\'s available',
          'NEW_MEMBER' =&gt; 'This user is new'
      );
      return $lang[$phrase];
  }
  //Then in application where there is text from the site and not from users I would do something like this
  echo lang('NO_PHOTO');  // No photo's available would show here
  ?&gt;
  </code></pre>