What are the performance implications of using preg_split() compared to explode() in PHP?

Using preg_split() in PHP can have performance implications compared to explode() because preg_split() uses regular expressions which can be slower than the simple string matching done by explode(). To improve performance, it is recommended to use explode() when splitting a string by a simple delimiter, such as a comma or space.

// Using explode() for better performance
$string = "apple,banana,cherry";
$items = explode(",", $string);
print_r($items);