Using the preg_match_all('~[,()^/*+-]~', $e, $m) and preg_split("/\,|\(|\)|\^|\/|\*|\-|\+/",$e); I break a string into an array of specific words.
I need to separate the string by words different from ^ ( , ) , ^ , / , * , - , + and not different from them.
For example:
pi*t+(a/c) In array(array('*','+','/'),array(pi,t,a,c)) .
My preg_split("/\,|\(|\)|\^|\/|\*|\-|\+/",$e); leaves empty elements in the resulting array.
()^/*-+. Give an example. - Wiktor Stribiżew[^,\(\)\^\/\*\-\+]- this syntax is used. The sign of denial is^- iosp[^,()^/*+-]. Maybepreg_split('~[^,()^/*+-]+~', $e)? Without examples it is difficult to understand exactly what is required. - Wiktor Stribiżew