<?php
$re = '/{youtube}(.*){\/youtube}/m';
$con="Life is good
{youtube}NgBZrRCPCH8{/youtube}
Fun is great!
{youtube}joRCPCH8{/youtube}
Earth is round and roll
{youtube}pwnkfH8{/youtube}";
preg_match_all($re, $str, $matches);
print_r($matches);
Warning: Undefined variable $str in /in/rNLfl on line 12
Deprecated: preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated in /in/rNLfl on line 12
Array
(
[0] => Array
(
)
[1] => Array
(
)
)
Output for 8.0.0 - 8.0.30
Warning: Undefined variable $str in /in/rNLfl on line 12
Array
(
[0] => Array
(
)
[1] => Array
(
)
)