3v4l.org

run code in 300+ PHP versions simultaneously
<?php function removeQuestionMarks($URL){ if(preg_match('/^http(s)?:\/\/example\.com\/forum\/.*$/',$URL) === 1){ $URL = trim($URL); $URL = str_replace("?","",$URL); } return str_replace([' ', '&'],['%20', '&amp;'],$URL); } echo removeQuestionMarks('https://example.com/forum/post/work/22/what-are-requirements-to-get-a-work-permit?/24'),PHP_EOL; echo removeQuestionMarks('https://example.com/forum/ why? is it difficult?/877');
Output for git.master, git.master_jit, rfc.property-hooks
https://example.com/forum/post/work/22/what-are-requirements-to-get-a-work-permit/24 https://example.com/forum/%20why%20is%20it%20difficult/877

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:
53.34 ms | 405 KiB | 5 Q