I have a youtube video embed code that looks like this:
<iframe width="560" height="315" src="http://www.youtube.com/embed/XGdfNb15h9o" frameborder="0" allowfullscreen></iframe>
I need to add the following (it gets rid of related video suggestions):
?rel=0
to the end of each url in the embed code. So in the above example, the final code should look like this:
<iframe width="560" height="315" src="http://www.youtube.com/embed/XGdfNb15h9o?rel=0" frameborder="0" allowfullscreen></iframe>
The embed code is stored in a variable called $embed_code. How can I transform the embed code to hav the ?rel=0 applied to it?
If everything else is staying constant you can use str_replace instead which will be faster.