What are the potential pitfalls of using the explode function in PHP, especially when dealing with complex data structures?

When using the explode function in PHP to split a string into an array, potential pitfalls can arise when dealing with complex data structures. One common issue is that explode only allows for a single delimiter, making it challenging to split strings with multiple delimiters. To solve this problem, you can use the preg_split function with a regular expression pattern to specify multiple delimiters.

$string = "apple,banana|cherry;date";
$delimiters = "/[,|;]/";
$parts = preg_split($delimiters, $string);

print_r($parts);