- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$re = '/{youtube}(.*){\/youtube}/mis';
$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);