I am using the following code to get youtube code in a long script. It works with this link
"bla bla bla bla http://www.youtube.com/watch?v=kkLTxsAhURw bla bla" but it does not work in this link ""bla bla bla bla http://www.youtube.com/watch?v=3YDz-ftqr1g bla bla"
It gets '3YDz' before the - but not the rest.. How can i get all code from the second link? Thanks.
preg_match('~v=([A-Za-z0-9]+)~', $txt, $match);