3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<DATA <CEK_STATUS> <HEADER> <NO_BARANG>ID1901422741</NO_BARANG> <TGL_HOUSE_BLAWB>2017/11/30</TGL_HOUSE_BLAWB> <KD_RESPON>408</KD_RESPON><WK_REKAM>2017/12/03 14:47:28</WK_REKAM> </HEADER> </CEK_STATUS> DATA; $array = [ "return" => $data ]; $obj = simplexml_load_string($array["return"]); echo $obj->HEADER->NO_BARANG . PHP_EOL; foreach($obj as $d) { echo $d->NO_BARANG . PHP_EOL; } foreach ($obj->xpath('/CEK_STATUS/HEADER') as $item) { echo $item->NO_BARANG . PHP_EOL; } $doc = new DOMDocument(); $doc->loadXML($data); $xpath = new DOMXpath($doc); foreach ($xpath->query('/CEK_STATUS/HEADER/NO_BARANG') as $i) { echo $i->nodeValue . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
ID1901422741 ID1901422741 ID1901422741 ID1901422741

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
54.9 ms | 405 KiB | 5 Q