How can preg_split() be used effectively in PHP to split strings based on multiple delimiters?

When using preg_split() in PHP to split strings based on multiple delimiters, you can achieve this by combining the delimiters using a regular expression within the function. Simply list the delimiters within square brackets [] to indicate any of the specified characters can be used as a delimiter. This allows you to split the string based on any of the specified delimiters.

$string = "Hello, World; PHP|Programming";
$delimiters = "/[,;|]/";
$parts = preg_split($delimiters, $string);

print_r($parts);