title: retrieve database values and then replace values with images outside of database
body: <p>I cannot get my head around how to do this. 
  I have a mysql table called 'companies' that has a column called 'language'. This language column contains country abbreviations (en, de, es...).</p>
  
  <p>Then I have flags saved in media/images/flags (en.png, de.png, es.png...).</p>
  
  <p>I do not want to save the flags in db but I want to change db-country abbrevs. into flags inside the code. Below, I store the country abbrevs from db inside abbrevs. and try somehow to match them to array keys.</p>
  
  <p>Model (platform_model):</p>
  
  <pre><code>    public function get_country(){
          $query = $this-&gt;db-&gt;query("SELECT language FROM companies");
          return $query;
      }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>    public function set_flag(){
      $this-&gt;load-&gt;model('platform_model');
      $abbrevs = $this-&gt;platform_model-&gt;get_country();
  
      $flags = array(
          'de' =&gt; base_url('media/images/flags/de.png'),
          'en' =&gt; base_url('media/images/flags/en.png'),
          'it' =&gt; base_url('media/images/flags/it.png'),
          'fr' =&gt; base_url('media/images/flags/fr.png'),
          'es' =&gt; base_url('media/images/flags/fr.png'),
          'pt' =&gt; base_url('media/images/flags/pt.png'),
          'ru' =&gt; base_url('media/images/flags/ru.png'),
          'ch' =&gt; base_url('media/images/flags/ch.png'),
          'ja' =&gt; base_url('media/images/flags/ja.png')
      );
  
      //how can I compare/replace them from here?
  </code></pre>
  
  <p>Thank you for help.</p>