I have a problem and hope for your help to resolve it.
1.I need to get a code from the youtube link (11 digits, which comes after watch?v=).
2.And remove all text which can be before and after the link, also the text could not be on a page, so anyway i need to get that video code.
For example: "lorem ipsum bla bla htttp://www.youtube.com/watch?v=12345678911 lorem ipsum blablabla".
I was wrote some expression but it doesnt work well :
$new_text = preg_replace('/.[https:\/\/www\.youtube\.com\/watch\?v=].*https:\/\/\www\.youtube\.com\/watch\?v=*(.{11}).*/s', '<img src=timthumb.php?src=http://img.youtube.com/vi/$1/maxresdefa ... h=90&w=230 />', $profile_post_content);