I-PHP: Ngaba ilula i-XML?

Iidipozithi iifoto 11843590 s

Kukho iiplagi ezimbalwa endizenzileyo ezifuna i-PHP5 + kunye ElulaXML. I-SimpleXML yeyona ndlela ilula kwaye isebenzayo yokwenza iindlela zeempendulo zeXML ukusuka APIs. Ingxaki, nangona kunjalo, kukuba ndiza kufumana ii-imeyile ezimbalwa ngosuku okanye ngeveki zindibuze ukuba kutheni umsebenzisi engakwazi ukulayisha inkqubo kwaye ikhokelele kwiimpazamo.

Kuyabonakala ukuba, izaziso zam kwiiplagi kunye nakwiphepha leprojekthi bezingonelanga, ndiye ndenza into elungileyo ndongeza ukusebenza kuzo zombini iiplagi ukuqinisekisa ulwandiso lwe-SimpleXML lulayishiwe.

Umsebenzi we-PHP ukukhangela ulwandiso lwe-SimpleXML lulayishiwe:

Umsebenzi nguSimpleXMLLoaded () {$ array = uluhlu (); $ array = fumana_izilayishi_zolwandiso (); $ isiphumo = bubuxoki; i-foreach ($ array njenge $ i => $ value) {if (strtolower ($ value) == "simplexml") {$ result = true; }} buyisela isiphumo seedola; }

Ngoku, ngaphakathi kwemisebenzi esebenzisa i-SimpleXML, ndinokuqinisekisa ukuba ilayishiwe ngaphambi kokuba ndizame umnxeba we-SimpleXML. Ukuba

ukuba (! isSimpleXMLLoaded ()) {echo "Bamba indawo yakho kwenye indawo!"; buyela; }

Ndiyazi ukuba ndinayo i-PHP gurus egcina ibhlog yam, ndazise indlela endenze ngayo! Ndikhuphe uhlaziyo oluncinci kuzo zombini iiPlagi ukusebenzisa le ndlela.

6 Comments

  1. 1

    Molo Doug,

    Ndiqaphele ibug enye enokuthi ingaphakamisi impazamo.

    ukuba ($ value = "SimpleXML") {$ result = true; }

    kufuneke ku

    ukuba ($ value == "SimpleXML") {$ result = true; }

    Nangona kungenxa yokhuseleko. Ndikhetha.

    ukuba (strtolower ($ value) == "simplexml") {$ result = true; }

    Unokusebenzisa 'ulwandiso_olayishiwe' oluthatha igama elandisiweyo ukujonga (imeko ibuthathaka).

    $ ulayishwe = ulwandiso_olayishiwe ("SimpleXML");

    Ibuyisa iNYANISO okanye UBUXOKI.

    I-PS Musa ukusela ikofu kodwa ndinokubeka 'ndithenge ibhokisi yeedonuts' iqhosha

    • 2

      Fumana iqhosha le-donut phezulu, uNick! Ungumsindisi! Into ehlekisayo kukuba (thabatha istolower), eneneni bendinayo ikhowudi yam yesampulu ebalekayo kwaye ndisebenzisa uvavanyo olufanelekileyo. Inokuba bekusebusuku ngoba ngelixesha ndiyifaka, ndiyimoshile!

      Ndiyilungisile ikhowudi kunye neposti yebhlog. Umbuzo: Ngaba ikhona into eluncedo enye phezu kwenye? Ndicinga ukuba ukwandiswa_kulayishwe kuyindlela ecocekileyo kwaye ekhawulezayo yokujongana noku!

      Enkosi Nick!

  2. 4

    yum ufake php55-xml.x86_64 ukufaka iXXL elula ye-php 5.5.11

    Ukuqhuba iTransekshini
    Ukufaka: php55-xml-5.5.11-1.el6.x86_64 1/1
    Ukuqinisekisa: php55-xml-5.5.11-1.el6.x86_64 1/1

    emva koko yafakwa
    /usr/lib64/php/modules/simplexml.so

  3. 5

Ingaba ucinga ntoni?

Le sayithi isebenzisa i-Akismet ukunciphisa ugaxekile. Funda indlela idatha yakho yokubhaliweyo isetyenziswe ngayo.