diff --git a/src/traits/CreateOption.php b/src/traits/CreateOption.php index ffc3f15..d0b5190 100755 --- a/src/traits/CreateOption.php +++ b/src/traits/CreateOption.php @@ -19,7 +19,11 @@ trait CreateOption } } else { foreach ($options as $val => $title) { - $selected = (int)$value === $val ? "selected" : ""; + if (is_numeric($value)) { + $selected = (int)$value === $val ? "selected" : ""; + } else { + $selected = $value === $val ? "selected" : ""; + } $optionsString .= ""; } }