3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[img]http://www.test.com/ abc.jpg[/img]"; $uid = 123; $text = preg_replace_callback( "#\[img]((?:https?|ftps?)://[^?&=\#\"<]*?\.(?:jpe?g|gif|png))\[/img]#i", function ($m) use ($uid) { return "[img:$uid]" . str_replace(' ', '%20', $m[1]) . "[/img:$uid]"; }, $text ); echo $text;
Output for git.master_jit, git.master, rfc.property-hooks
[img:123]http://www.test.com/%20%20abc.jpg[/img:123]

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