'cpu':2 '98.00':8 '100.00':4 'exceeds':5 'problem':1 'threshold':7 'configured':6 'utilization':3
How can I covert the above result to
CPU | 98.00 | 100.00 | exceeds | problem | threshold | configured | utilization
I need to pick up the word inside 'word'
Regular expressions are the way to go.
Try this:
preg_match_all("/'([']+)'[']+/",$input,$matches); $output = implode(' | ',$matches[1]);
This way $output will contain the string with the desired output.