change count(explode()) to substr_count() to improve performance