I’m trying to take the basic youtube embed code and bbreak it up into variables of height width and url but the code im using keeps throwing a error.
<?php
$width = "10";
$height = "20";
$vid url = "http://www.youtube.com/embed/HjgSmoilwV4";
echo '<iframe width="'$width'" height="'$height'" src="'$vid'" frameborder="0"allowfullscreen></iframe>';
?>
using this code im getting the following error
Parse error: syntax error, unexpected T_STRING in D:\webdesign\webserver\root\dynapage\scripts\admin\add_video.php on line 4
What am I doing wrong? I’ve Googled and found stuff on escaping but not sure what it expects me to escape.
Line 4 $vid url , can’t have that space there, it’s a syntax error.
so change it to:
and that last line should be: