3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convert_instagram_links( $instagram_caption_a_title ) { // Create links from @mentions, #hashtags and regular links. $instagram_caption_a_title = preg_replace( '~https?://[^<>\s]+~i', '<a href="$0" target="_blank">$0</a>', $instagram_caption_a_title ); $instagram_caption = preg_replace( '/#+(\w+)/u', '<a href="https://www.instagram.com/explore/tags/$1" target="_blank">$0</a>', $instagram_caption_a_title ); $instagram_caption = preg_replace( '/@+(\w+)/u', '<a href="https://www.instagram.com/$1" target="_blank">@$1</a>', $instagram_caption ); return $instagram_caption; } echo convert_instagram_links('@tags_underscore or #hashtags_underscore');
Output for git.master, git.master_jit, rfc.property-hooks
<a href="https://www.instagram.com/tags_underscore" target="_blank">@tags_underscore</a> or <a href="https://www.instagram.com/explore/tags/hashtags_underscore" target="_blank">#hashtags_underscore</a>

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