ripple - 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.
Result of php executing
Full code of ripple.php
- <?php
- $text = <<<XML
- <ws_response>
- <status>OK</status>
- <resp_value>OK</resp_value>
- <resp_detail>
- <responseStatus>
- <status>SUCCESS</status>
- <requestId>RQT-397731730</requestId>
- </responseStatus></resp_detail>
- </ws_response>
- XML;
- $xml = simplexml_load_string($text);
- // get the result with xpath (apparently always returns an array)
- $result = $xml->xpath('//resp_detail/responseStatus/status/text()');
- var_dump($result);
- var_dump((string) $result);
- var_dump($result[0]);
- // get the string with simplexml's object syntax
- var_dump((string) $xml->resp_detail->responseStatus->status);
- // i expected this to be an error
- var_dump((string) $xml->resp_detail->fakefake->status);
File Description
- ripple
- PHP Code
- 28 Oct-2020
- 692 Bytes
You can Share it:
Latest PHP Pastes