3v4l.org

run code in 300+ PHP versions simultaneously
<?php mb_internal_encoding('UTF-8'); $html = <<< HTML <!doctype html> <html> <head> <meta charset="utf-8" /> <title>Test Page</title> </head> <body> <p>One two Three fourfive six</p> </body> </html> HTML; $html = mb_convert_encoding($html, 'HTML-ENTITIES', "UTF-8"); $dom = new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); $query = $xpath->query("/html/body"); $body = $dom->saveXML($query->item(0)); $body = strip_tags($body); echo end(explode("Three four", $body));
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: mb_convert_encoding(): Handling HTML entities via mbstring is deprecated; use htmlspecialchars, htmlentities, or mb_encode_numericentity/mb_decode_numericentity instead in /in/uBiDu on line 16 Notice: Only variables should be passed by reference in /in/uBiDu on line 23 five six

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:
40.81 ms | 401 KiB | 8 Q