its it possible to have two ELSEIF clauses in a IF ternary?
<p>can this be made into an IF ternary to shorten the code? I don't know how to do it with multiple elseif clause</p>

<pre><code>if ($ext == "m") {
 $extype = "mp3";
}elseif ($ext == "w") {
 $extype = "wav";
}elseif ($ext == "a"){
 $extype = "aac";
}
</code></pre>

<p>the is the full function </p>

<pre><code>function loc($id,$type,$ext) //loc($id,'n',$ext) 
{
  if (($query = mysql_query("SELECT loc FROM names WHERE id = '".(int)$id."'")) !== false)
  {
    if (mysql_num_rows($query) &gt; 0)
     if ($ext == "m") {
     $extype = ".mp3";
     }elseif ($ext == "w") {
     $extype = ".wav";
     }elseif ($ext == "a") {
     $extype = ".aac";
     }
      return '/rec/'.mysql_result($query,0,'loc').$id.'-'.($type=='n'?'n':'s').$extype); 

  }
  return 'Error Not Found';
}
</code></pre>
