3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0" encoding="UTF-8"?> <root> <area> <photographer_id>1</photographer_id> <photographer>John</photographer> <image>a</image> </area> <area> <photographer_id>1</photographer_id> <photographer>John</photographer> <image>b</image> </area> <area> <photographer_id>1</photographer_id> <photographer>John</photographer> <image>c</image> </area> <area> <photographer_id>2</photographer_id> <photographer>Fred</photographer> <image>a</image> </area> </root> XML; $sxe = new SimpleXMLElement($xml); $searchKeyword = "John"; $area = $sxe->xpath("//area[contains(photographer,'".$searchKeyword."')]"); print_r($area);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => SimpleXMLElement Object ( [photographer_id] => 1 [photographer] => John [image] => a ) [1] => SimpleXMLElement Object ( [photographer_id] => 1 [photographer] => John [image] => b ) [2] => SimpleXMLElement Object ( [photographer_id] => 1 [photographer] => John [image] => c ) )

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:
38.51 ms | 402 KiB | 8 Q