PHP function for ordering sysmbol