Codeigniter:如何使用Foreach Loop将“Selected”写入选项?

Here my problems

How can I make it like I specified in picture? I narrate with a picture due to the need to translate to English. I hope it is clear.

               <?php
                   $str = $rows[0]->oda_oz;
                      $newstr= (explode(";",$str));
                      print_r($newstr);
                      foreach ($get_ozellikler as $ozellikler ) {
                       $s=($newstr[0] ==   $ozellikler->id )? 'selected':'';  ?>
                       <option  <?php echo $s; ?> value="<?php echo $ozellikler->id; ?>" >
                        <?= $ozellikler->name; ?>
                             </option>
                                 <?php  } ?