23 lines
431 B
PHP
23 lines
431 B
PHP
<?php
|
|
|
|
namespace App\Livewire\Mapper;
|
|
|
|
class SearchString
|
|
{
|
|
public static function explode($string)
|
|
{
|
|
$string = str_replace([',', '/', '&'], '', $string);
|
|
|
|
$tmp = preg_split('/\s+/', $string, -1, PREG_SPLIT_NO_EMPTY);
|
|
|
|
$return = [];
|
|
foreach ($tmp as $value) {
|
|
if (strlen($value) > 1) {
|
|
$return[] = $value;
|
|
}
|
|
}
|
|
|
|
return $return;
|
|
}
|
|
}
|