Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在php中使用echo_Php_Html - Fatal编程技术网

在php中使用echo

在php中使用echo,php,html,Php,Html,当你创建任何网站,你一定要使用HTML代码为建筑块和一般建设网站 这段代码通常在php文件中,因为创建一个单独的文件,然后再创建另一个inkluda是没有意义的 Pripustit有一个PHP文件,其中包含以下代码: <?php $title='Title'; $content='Content//'; echo <<<HTML <div class='title'>$title</div> <div class='content'>

当你创建任何网站,你一定要使用HTML代码为建筑块和一般建设网站

这段代码通常在php文件中,因为创建一个单独的文件,然后再创建另一个inkluda是没有意义的

Pripustit有一个PHP文件,其中包含以下代码:

<?php
$title='Title';
$content='Content//';

echo <<<HTML
<div class='title'>$title</div>
<div class='content'>$content</div>
HTML;

?>

但它仍然可以带来这样的结果

    <?php
$title='Title';
$content='Content//';
?>

<div class='title'><?echo$title;?></div>
<div class='content'><?echo$content;?></div>

一般来说,问题是我应该使用什么方法?根据想法,第二种方法应该更快,但速度非常快?或者,有没有可能不去想它,写一篇更方便的文章


例如,如果在echo中输出大量HTML代码?

当然,如果使用较小的命令集,速度会更快。在这种情况下,最有可能的是,最好放弃回声,因为它是对任何东西


如果我们使用功能并测量有无回波的输出,则相差约半秒不利于回波。

使用合理的方法。如果你想知道大多数人都在做什么,那就去GitHub看看.Smarty或其他模板引擎,PHP中的输出速度非常快。这是最不重要的事。