add php version of strpmap