PHP code in embed tag
I'm using embed
tag in PHP like this:
echo "<embed src='images/meccaAdhan.mp3' name='guitar' id='BGS_ID' autostart='true' loop='false' width='2' height='0'></embed>";
开发者_如何转开发I need to add this code before images:
templates/<?php echo $this->template ?>
Please guide me how to solved it.
Use string concatenation:
echo "<embed src='templates/" . $this->template . "/images/meccaAdhan.mp3' ... >";
See PHP: Strings for the different string manipulations available.
echo "<embed src=\"templates/{$this->template} ...
or
?><ebmed src="templates/<? echo $this->template ?> ...
as examples.
精彩评论