grabbing variable...from inside a string
Posted: Mon Mar 18, 2013 4:21 pm
Hello
So I want to make it very easy for site visitors to share videos that they find on youtube.
At first I was requiring them to copy and paste the embed code and the video url(for like buttons)
I feel that it's a little to much for them and most of the time they mess up.
Now I want to store only the url but the most important aspect of the url is the variable "v".
Example: http://www.youtube.com/watch?v=ccT8C2wSC6Y
The important piece is ?v=ccT8C2wSC6Y
unfortunately when that variable is stored inside the database I don't know how to grab the ?v=ccT8C2wSC6Y
part which is needed for thumbnails.
My question is... how can I store the video url http://www.youtube.com/watch?v=ccT8C2wSC6Y inside the database
and later grab the ?v=ccT8C2wSC6Y part only.
(just entering in ?v=ccT8C2wSC6Y is not a solution for other reasons)
So I want to make it very easy for site visitors to share videos that they find on youtube.
At first I was requiring them to copy and paste the embed code and the video url(for like buttons)
I feel that it's a little to much for them and most of the time they mess up.
Now I want to store only the url but the most important aspect of the url is the variable "v".
Example: http://www.youtube.com/watch?v=ccT8C2wSC6Y
The important piece is ?v=ccT8C2wSC6Y
unfortunately when that variable is stored inside the database I don't know how to grab the ?v=ccT8C2wSC6Y
part which is needed for thumbnails.
My question is... how can I store the video url http://www.youtube.com/watch?v=ccT8C2wSC6Y inside the database
and later grab the ?v=ccT8C2wSC6Y part only.
(just entering in ?v=ccT8C2wSC6Y is not a solution for other reasons)