📌  相关文章
📜  如何在 php 代码示例中动态设置选择选项值

📅  最后修改于: 2022-03-11 14:54:28.641000             🧑  作者: Mango

代码示例1
foreach($optionArr as $key => $value){
   $isSelected =""; //added this line
   if($_REQUEST['opt_side_'.$cside] == $value){
     $isSelected = "selected";
   }
   echo '';
}


//Laravel

@php
$optionArr = array ('Available' => 'Available', 'Not Available' => 'Not Available',  'Sold Out' => 'Sold Out',);
@endphp