diff --git a/src/traits/CreateOption.php b/src/traits/CreateOption.php
index 0ba5071..ffc3f15 100755
--- a/src/traits/CreateOption.php
+++ b/src/traits/CreateOption.php
@@ -12,10 +12,18 @@ trait CreateOption
public function createOption(array $options, $value = null): string
{
$optionsString = "";
- foreach ($options as $val => $title){
- $selected = (int)$value === $val ? "selected" : "";
- $optionsString .= "";
+ if (is_array($value)) {
+ foreach ($options as $val => $title) {
+ $selected = in_array($title, $value) ? "selected" : "";
+ $optionsString .= "";
+ }
+ } else {
+ foreach ($options as $val => $title) {
+ $selected = (int)$value === $val ? "selected" : "";
+ $optionsString .= "";
+ }
}
+
return $optionsString;
}
}
\ No newline at end of file