• 26-05-2015, 15:17:12
    #1
    Merhaba,

    sanal pos için php sayfasına dönen xml cevabının içerisinden bir bölümü almam gerekmekte. Bu konuda yardımlarınızı rica ederim.

    Dönen XML örneği :

    <?xml version="1.0" encoding="utf-8"?><ePaymentMsg VersionInfo="2.0" TT="Response" RM="Direct" CT="Money"><Operation><OpData><MerchantInfo MerchantId=""></MerchantInfo><ActionInfo><DateInfo LocalDate="20150522" LocalTime="1535"></DateInfo><TrnxCommon TrnxID="" Protocol="156"><AmountInfo Currency="949" Amount="0.0"></AmountInfo></TrnxCommon><POSTrnxID LIDM="111111111111111111111111111111" RRPID="111111111111111111111111111111"></POSTrnxID><HostResponse AuthCode="" HostRefNo="11111111" HostDate="" ResultCode="1001"></HostResponse><BatchInfo BatchId="1" Stan="111"></BatchInfo><PaymentTypeInfo><InstallmentInfo NumberOfInstallments="0"></InstallmentInfo></PaymentTypeInfo></ActionInfo><CustomData></CustomData></OpData></Operation></ePaymentMsg>

    bu xml döngüsündeki ResultCode alanının içeriğini php ile nasıl çekebilirim ?
  • 26-05-2015, 15:33:33
    #2
    dönen değerin değişkeni örneğin $result

    $result = simplexml_load_string( $result );
    
    //print_r( $result ); // Çıktıyı görebilirsin.
    echo (int) $result->Operation->OpData->ActionInfo->HostResponse->attributes()->ResultCode;
  • 26-05-2015, 15:43:46
    #3
    çok teşekkür ederim üstad, çalıştı.