Thank you, but dont work:
$text = preg_replace("/\[youtube\](http:\/\/)?(www\.)?youtube\.com\/watch\?v=([^&]+)\[\/youtube\]/i", "<object width=\"150\" height=\"150\"><param name=\"movie\" value=\"\\5?fs=1&hl=de_DE&rel=0\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"\\5?fs=1&hl=de_DE&rel=0\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"150\" height=\"150\"></embed></object>", $text);
I want to be between [youtube] and [/ youtube] can enter the address of a video. There will be no matter what the address looks like. This should be rewritten more generally in the right shape so that the embed code to work.
This work:
$text = preg_replace("/\[youtube\](.*)youtube.com\/watch\?v=(.*)\[\/youtube\]/Usi", "<object width=\"425\" height=\"344\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\2&hl=de&fs=1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed src=\"http://www.youtube.com/v/\\2&hl=de&fs=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object>", $text);