public static String utworz(String s) {
try
{
String s1 = "";
String[] asd = s.Split('/');
String[] as1 = asd[2].Split('.');
//System.out.println("-->" + as1[0] + "---" + as[4] + "<---");
Random random = new Random();
int licz = random.Next(1000000);
String s3 = "http://" + as1[0] + ".atuzrw.pl/xml/plik/
" + asd[4] + "/atuzrw.pl/pl/
" + licz;
//System.out.println(s3);
HttpWebRequest url = (HttpWebRequest)WebRequest.Create(s3);
url.Timeout = 10000;
url.UserAgent = @"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; pl; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13";
StreamReader bufferedreader = new StreamReader(url.GetResponse().GetResponseStream());
string retContent = bufferedreader.ReadToEnd();
bufferedreader.Close();
string nurl = "";
nurl = Regex.Match(retContent, "<fileId>(.*?)</fileId>", RegexOptions.IgnoreCase).Groups[1].Value;
nurl = nurl.Replace("<![CDATA[", "");
nurl = nurl.Replace("]]>", "");
return nurl;
}
catch (Exception exp)
{
throw new Exception(exp.Message);
}
}
Przepisał by to ktoś na PHP ??