- print_r: documentation ( source)
- preg_split: documentation ( source)
<?php
$strings = [
"quanity*price/2+tax",
"quanity*price/2"
];
foreach ($strings as $string) {
$keywords = preg_split("/[-*\/+\d]+/", $string, -1, PREG_SPLIT_NO_EMPTY);
print_r($keywords);
}