Are there any potential pitfalls when using multiple delimiters with explode in PHP?

When using multiple delimiters with explode in PHP, one potential pitfall is that the delimiters must be specified in the correct order. If the delimiters are not provided in the correct order, the explode function may not work as expected and may not split the string into the desired array elements. To solve this issue, make sure to list the delimiters in the order they appear in the string.

$string = "apple,banana;cherry-orange";
$delimiters = [",", ";", "-"];
$result = preg_split('/[' . implode('', $delimiters) . ']/', $string);
print_r($result);