3v4l.org

run code in 300+ PHP versions simultaneously
<?php function replace($url){ $url = str_replace("\\r","\r",$url); $url = str_replace("\\n","\n<BR>",$url); $url = str_replace("\\n\\r","\n\r",$url); $in=array( '`(?:https?|ftp)://\S+[[:alnum:]]/?(?<!\.(png|jpeg|jpg|gif)\b)`si', '`(?<!//)(www\.\S+[[:alnum:]]/?)(?<!\.(png|jpeg|jpg|gif)\b)`si', //'`(?:https?|ftp)://\S+[[:alnum:]]\.(png|jpeg|jpg|gif)\b`si', //'`(?<!//)(?:www\.\S+[[:alnum:]]\.(png|jpeg|jpg|gif)\b)`si' ); // это для ссылок и фото $out=array( '<a style="color:navy;" href="$0" rel="nofollow">$0</a>', '<a style="color:navy;" href="http://$0" rel=\'nofollow\'>$0</a>', //'<img src="$0" rel="nofollow">', //'<img src="http://$0" rel=\'nofollow\'>' ); return preg_replace($in, $out, $url); } echo replace('dfd dfdf http://site.ru/ ddd fff http://img.com/pic.png text');
Output for git.master, git.master_jit, rfc.property-hooks
Warning: preg_replace(): Compilation failed: lookbehind assertion is not fixed length at offset 33 in /in/PUvoE on line 20

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