Parse first string - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of Parse first string.php

  1. <?php
  2. $input = 'command=bill&bill_id=1&status=paid&error=0&amount=1.00&user=tel%3A%2B79067052439&prv_name=test&ccy=RUB&comment=249
  3. "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
  4. xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
  5. soap:mustUnderstand="1"><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"Id="SIG-b11c7ec2-1f64-4c79-89ed-6b140e38fc5d">
  6. <ds:SignedInfo>
  7. <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
  8. <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="soap"/>
  9. </ds:CanonicalizationMethod><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
  10. <ds:Reference URI="#id-66a3cfe1-211c-4752-ba10-3e7e46db3b19">
  11. <ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
  12. <ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList=""/>
  13. </ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
  14. <ds:DigestValue>pd0nJ2QWwllrVNhEAIzgbJ4oyUM=</ds:DigestValue>
  15. </ds:Reference>
  16. </ds:SignedInfo>
  17. <ds:SignatureValue>PIpmCkqL8Wvlb+fKNmrPaySP+rk6GAOogSah/u1Jw6ZPUrM1PNfwCY5afk1PkvgBs9mf97tqOtoyIEwWF0YhiqpIzjgMSzF09RMGYsAfoDQRdWktmwM2kWk4xLwm8eHXuoqonkXv/skRi3HNo6pZDkJxlqNwX3+HjnFUwFr3KZk=
  18. </ds:SignatureValue>
  19. <ds:KeyInfo Id="KI-7a67103e-fa44-4908-b29b-c107a773cfb3">
  20. <wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="STR-60e159c8-5294-4c57-b207-151720dedbb1">
  21. <ds:X509Data>
  22. <ds:X509IssuerSerial>
  23. <ds:X509IssuerName>CN=mobw.ru</ds:X509IssuerName>
  24. <ds:X509SerialNumber>1242724091</ds:X509SerialNumber>
  25. </ds:X509IssuerSerial></ds:X509Data></wsse:SecurityTokenReference>
  26. </ds:KeyInfo></ds:Signature></wsse:Security>
  27. </SOAP-ENV:Header>
  28. <soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-66a3cfe1-211c-4752-ba10-3e7e46db3b19">
  29. <ns2:updateBill xmlns:ns2="http://client.ishop.mw.ru/">
  30. <login>555234</login>
  31. <password>F5263E734AE8BAEDA24D81DE11732DAC</password>
  32. <txn>RTfwbx7vuqaUDLYEuVZ7TFxByCMhFR7HPcFajlHWJC7cSXswih</txn>
  33. <status>60</status>
  34. </ns2:updateBill>
  35. </soap:Body>
  36. </soap:Envelope>';
  37.  
  38. $str = strtok($input, "\n");
  39. parse_str($str, $result);
  40.  
  41. echo $result['amount'];
  42. echo ' ';
  43. echo $result['comment'];
  44.  
  45.  
File Description
  • Parse first string
  • PHP Code
  • 19 Jun-2018
  • 2.46 Kb
You can Share it: