The string I am trying to split is $item[\'category_names\'] which for example contains Hair, Fashion, News
$item[\'category_names\']
Hair, Fashion, News
I currently have the following
PHP explode array by loop demo: http://sandbox.onlinephpfunctions.com/code/086402c33678fe20c4fbae6f2f5c18e77cb3fbc2
its works for me