3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'This is a text with multiple anchor tags. This is the first one: <a class="funky-style" href="https://www.link1.com/" title="Link 1">Link 1</a> and this one the second: <a href="https://www.link2.com/" title="Link 2">Link 2</a> after that a lot of other text. And here the 3rd one: <a href="https://www.link3.com/" title="Link 3">Link 3</a> Some other text.'; $pos = strpos($str, '<a'); While($pos !== false){ $str = substr($str, 0, $pos) . substr($str, strpos($str, 'href="', $pos)+6); $str = substr($str, 0, strpos($str,'"', $pos)) . substr($str, strpos($str, '</a>', $pos)+4); $pos = strpos($str, '<a'); } Echo $str;
Output for git.master_jit, git.master, rfc.property-hooks
This is a text with multiple anchor tags. This is the first one: https://www.link1.com/ and this one the second: https://www.link2.com/ after that a lot of other text. And here the 3rd one: https://www.link3.com/ Some other text.

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:
107.36 ms | 406 KiB | 5 Q