Is it more efficient to remove brackets and spaces from a string and use explode rather than regular expressions in PHP?

When dealing with removing brackets and spaces from a string in PHP, using explode can be more efficient than regular expressions. This is because explode is a simpler function that splits a string based on a specified delimiter, such as brackets or spaces, without the overhead of regex processing.

$string = "(Hello World)";
$cleanedString = str_replace(["(", ")", " "], "", $string);
$explodedString = explode(",", $cleanedString);

print_r($explodedString);