Several styles of embedding php code in HTML
<code><span><span>html</span>></span><span>head</span>><span>meta</span><span>charset</span>=<span>"utf-8"</span>><span>title</span>> New Document <span><span>title</span>></span><span><span>head</span>></span><span>body</span>><span><span><?php </span><span>echo</span><span>'标准写法,类似xml写法'</span>.<span>'<br>'</span>; <span>echo</span><span>'我后面的分号可以省略的,但是不推荐<br>'</span><span>?></span></span><span>script</span><span>language</span>=<span>"php"</span>></span><span> echo<span>'这是脚本风格的标记'</span>.<span>'<br>'</span>; </span><span><span>script</span>></span><span><span></span><span>//需要在php.ini 设置short _open_tag=on</span><span>echo</span><span>"短标签的写法"</span>.<span>'<br>'</span>; <span>?></span></span><span>on</span> echo <span>"这是asp风格"</span>.<span>'<br>';</span> %><span><span>body</span>></span><span><span>html</span>></span><span><span><?php </span><span>echo</span><span>'当php后面没有非php代码,最后的结束标记可以省略!!'</span>; <span>#shell风格注释</span><span>//单行注释</span><span>/* *我是多行注释 */</span></span></span></code>
The above has introduced several styles of PHP code, including aspects of content. I hope it will be helpful to friends who are interested in PHP tutorials.