[UTIL] Add Formatting::explode(array , string )
This commit is contained in:
parent
dac94f53cd
commit
87e35716c1
|
@ -235,6 +235,19 @@ abstract class Formatting
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Like \explode, but with multiple options for the delimiter. Will use the first one present
|
||||
*/
|
||||
public static function explode(array $separators, string $string)
|
||||
{
|
||||
foreach ($separators as $sep) {
|
||||
if (str_contains($string, $sep)) {
|
||||
return explode($sep, $string);
|
||||
}
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a plain text note content into HTML, extracting links and tags
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user