3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "# 12 # # # # Hello World"; $strArr = explode(' ', $str); $strArrKeys = array_keys($strArr, '#'); $strArrSplit = array_pop($strArrKeys) + 1; //all after the last # $subArr = array_slice($strArr, $strArrSplit); echo implode(' ', $subArr); //all before the last # (inluding the #). $subArr = array_slice($strArr, 0, $strArrSplit); echo implode(' ', $subArr);
Output for git.master, git.master_jit, rfc.property-hooks
Hello World# 12 # # # #

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.88 ms | 401 KiB | 8 Q