How can regular expressions be used to split a string with multiple delimiters in PHP?

Regular expressions can be used in PHP to split a string with multiple delimiters by using the preg_split() function. This function allows you to specify a regular expression pattern that matches the delimiters you want to split the string on. By using a regular expression pattern that includes all the delimiters, you can split the string into an array of substrings based on those delimiters.

$string = "Hello,World;How|Are-You";
$delimiters = "/[,\|;-]/";
$parts = preg_split($delimiters, $string);

print_r($parts);