本文介绍了什么是:用于PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚开始在wordpress中开发主题并在index.php上看到此代码 -





Just started developing themes in wordpress and saw this code on index.php -


<?php if (have_posts()) : ?>

		<?php while (have_posts()) : the_post(); ?>







什么是用于上面的代码?它做了什么?



我搜索但在互联网上找不到答案。




What is : used for in the above code ? What does it do ?

I searched but couldn't find the answer on the internet.

推荐答案

<?php if (isset(






这种方式不是使用像这样繁琐的东西:



This way instead of using something cumbersome like this :

<?php <br mode="hold" /?>  if (isset(






在这个非常小的例子中,下面的代码看起来很简单,但是当你开始在这些echo方法中放入真正的标签和链接,整个代码很快就会变脏和不可读。



所以,这是一个更好的方法来使用以前的方式编码以生成更干净和可读的代码。简单对代码运行时间等没有太大影响。



如果,这是你需要的答案,请将其标记为已解决:)



问候

Tushar Srivastava



In this very small example, the code below seems simple but when you start to put real tags and links inside these echo methods, the whole code become dirty and unreadable very soon.

So, it is a better method to use the former way of coding to generate more clean and readable code. It simple has no big effect on code running time etc.

If, this is the answer you need then, please do mark it as solved :)

With Regards
Tushar Srivastava


这篇关于什么是:用于PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 13:15