3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "we have a card [mtgcard]tarmogoyf[/mtgcard] "; $string .= "and [mtgcard]forest[/mtgcard] "; $string = preg_replace('/\[mtgcard\](.*?)\[\/mtgcard\]/', '<a href="https://deckbox.org/mtg/$1">$1</a>', $string); echo $string; $string = "we have a card [mtgcard]tarmogoyf[/mtgcard] "; $string .= "and [mtgcard]forest[/mtgcard] "; preg_match_all('/\[mtgcard\](.*?)\[\/mtgcard\]/', $string, $matches); $arr = $matches[1]; foreach ($arr as &$a) { $a = "<a href=\"https://deckbox.org/mtg/$a\">$a</a>"; } print_r($arr);
Output for git.master, git.master_jit, rfc.property-hooks
we have a card <a href="https://deckbox.org/mtg/tarmogoyf">tarmogoyf</a> and <a href="https://deckbox.org/mtg/forest">forest</a> Array ( [0] => <a href="https://deckbox.org/mtg/tarmogoyf">tarmogoyf</a> [1] => <a href="https://deckbox.org/mtg/forest">forest</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:
17.54 ms | 402 KiB | 8 Q