Здравствуйте, может кто сможет помочь преобразовать часть кода из С# в PHP? Код (Text): private ArrayList _getEventList(ArrayList file_list) { ArrayList event_list = new ArrayList(); foreach (string file in file_list) { StreamReader sr = new StreamReader(this._temp_directory + "\\" + file); string line; string[] res_str_array = new String[0]; string month = ""; string year = ""; while ((line = sr.ReadLine()) != null) { try { Regex reg = new Regex("([a-zA-Z]+).+([0-9]{4})"); Match matchRes = reg.Match(line); if (matchRes.Success) { month = matchRes.Groups[1].Value; year = matchRes.Groups[2].Value; } reg = new Regex("(\\d+)\\s+(\\d+)\\s+([0-9]+:[0-9 ]+:[0-9 ]+.[0-9])\\s+([0-9]{0,3}.[0-9]{0,2})\\s+([N|S])\\s+([0-9]{0,3}.[0-9]{0,2})\\s+([E|W])\\s+(\\d+)\\s+(\\d+.\\d+)\\s+([0-9\\.]*)\\s+([0-9\\.]*)"); matchRes = reg.Match(line); if (matchRes.Success) { res_str_array = new String[9]; res_str_array[0] = matchRes.Groups[1].Value; //NN DateTime dt = new DateTime(Convert.ToInt32(year), this._convertMothnToNumber(month), Convert.ToInt32(matchRes.Groups[2].Value)); res_str_array[1] = dt.ToString("d"); //Day res_str_array[2] = matchRes.Groups[3].Value.Substring(0, matchRes.Groups[3].Value.Length - 2); //Origin_time if (matchRes.Groups[5].Value == "S") { res_str_array[3] = "-" + matchRes.Groups[4].Value; //Latitude } else { res_str_array[3] = matchRes.Groups[4].Value; //Latitude } if (matchRes.Groups[7].Value == "W") { res_str_array[4] = "-" + matchRes.Groups[6].Value; //Longitude } else { res_str_array[4] = matchRes.Groups[6].Value; //Longitude } res_str_array[5] = matchRes.Groups[8].Value; //h res_str_array[6] = matchRes.Groups[9].Value; //MPSP res_str_array[7] = matchRes.Groups[10].Value; //MPLP res_str_array[8] = matchRes.Groups[11].Value; //MS event_list.Add(res_str_array); } } catch (Exception ex) { _loglist.AppendText("Будет обработано сейсмических событий " + ex.Message + "\r\n"); } } } _loglist.AppendText("Будет обработано сейсмических событий " + event_list.Count.ToString() + "\r\n"); return event_list; }