hoho Posted March 20, 2007 Report Share Posted March 20, 2007 Meegonu ar php apstradat XML failu piemeeram ......... <RentPrice Currency="EUR" PricingUnit="Month">1500.0000</RentPrice> ............. php es uztaisiiju field rules: $FIELD_RULES = array ( ................... "RentPrice" =>"PRICE::string", ................... ) bet kaa dabuut Currency veertiibu? Link to comment Share on other sites More sharing options...
bubu Posted March 20, 2007 Report Share Posted March 20, 2007 Kas ir "field rules"? Vispārīgā gadījumā - parsē XML, un skaties tagus/atribūtus ar if'iem un velc āra vajadzīgo informāciju (tb saglabā kautkur, piemēram, masīvā). Kā parsēt xml, to nu tev pašam labāk zināt, nevis mums uzminēt. Ja nezini, tad atver php manuāli un uzšķir xml funkciju sarakstu. Link to comment Share on other sites More sharing options...
Paulinjsh Posted March 20, 2007 Report Share Posted March 20, 2007 ja ir pieejams SimpleXML, tad uzdevums kļūst pavisam triviāls Link to comment Share on other sites More sharing options...
localhero Posted March 21, 2007 Report Share Posted March 21, 2007 Kaut kaa taa: $xml = simplexml_load_file(curency.xml); foreach ($xml->curency as $curency) { printf("<b>Valutas kurs:</b> %s\n", $curency); } Protams varetu vairak tev palidzet ja redzetu konkretu xml failu. Link to comment Share on other sites More sharing options...
Recommended Posts