protected function DisableLanguageSettings::explodeToArray in Disable language 8
Given a string with newlines, returns an array with values.
Parameters
string $string: The string to explode.
Return value
array|array[]|false|string[] Return value.
2 calls to DisableLanguageSettings::explodeToArray()
- DisableLanguageSettings::submitForm in src/
Form/ DisableLanguageSettings.php - Form submission handler.
- DisableLanguageSettings::validateForm in src/
Form/ DisableLanguageSettings.php - Form validation handler.
File
- src/
Form/ DisableLanguageSettings.php, line 156
Class
- DisableLanguageSettings
- Class DisableLanguageSettings.
Namespace
Drupal\disable_language\FormCode
protected function explodeToArray($string) {
$array = preg_split("[\n|\r]", $string);
$array = array_filter($array);
return $array;
}