添加html <a> tag in php

时间:2015-12-11 12:51:09

标签: php html

Is there any way to add an html <a> code in a php script like here:

<div id="flashDiv" align="center" style="position:absolute; top:20%; left:30%; z-index:51;">
<?php if ($OS == Windows): ?>
<a target="_blank" href="http://localhost/file.exe">
    <img src="http://localhost/flower.png"></img>
</a>
</div>
<?php else: ?>
nothing

1 个答案:

答案 0 :(得分:1)

您需要使用正确的语法:p

<div id="flashDiv" align="center" style="position:absolute; top:20%; left:30%; z-index:51;">
<?php if ($OS == "Windows"): ?>
<a target="_blank" href="http://localhost/file.exe">
    <img src="http://localhost/flower.png">
</a>
</div>
<?php endif; ?>