I have a URL in my iFrame:
<iframe src="http://example.com/video/123/"></iframe>
.
In PHP, how do I edit this to add ?wmode=transparent
to the end of the URL.
Thank you
I have a URL in my iFrame:
<iframe src="http://example.com/video/123/"></iframe>
.
In PHP, how do I edit this to add ?wmode=transparent
to the end of the URL.
Thank you
You could just echo the string in the url.
<iframe src="http://example.com/video/123/<?php echo "?wmode=transparent" ?>></iframe>
Let's say you've got a php page that will print the following html:
<iframe src="http://example.com/video/123/"></iframe>
With php you can do a lot of things, as example:
<?php
$myVarToAppend = "?wmode=transparent"; //Putting the val inside a variable.
?>
<iframe src="http://example.com/video/123/<?php print $myVarToAppend; ?>"></iframe>
The var can be populated with a lot of things like DataBase Response or what you want. That said if you need to do this on runtime (without page reload) you need to do it with Javascript
Edit: I've choose to not print all the String because it's better to use php only when needed, no gain in printing everything with it.
Edit2: After your comment, you've said you've got two String:
Attention, your string written as below don't work well, the " are putted wrongly.
$string = "<p>test</p><iframe src="http://example.com/video/123/"></iframe><p>test</p>";
and
$toAdd = "?wmode=transparent";
you can do it this way: I use . for concatenation of strings.
$string = '<p>test</p><iframe src="http://example.com/video/123/'.$toAdd.'"></iframe><p>test</p>';
There are maybe other ways too, but with so little information is the maximum i can do for now.
test
test
";` - how do I append `?wmode=transparent` to the end of the URL? – michaelmcgurk Nov 24 '14 at 14:18
test
test
";` - how do I append `?wmode=transparent` to the end of the URL? – michaelmcgurk Nov 24 '14 at 14:15