php,wordpress在两个echo语句中添加换行符 [英] php, wordpress add line break with in two echo statements

查看:76
本文介绍了php,wordpress在两个echo语句中添加换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?php if (is_page_template()) { 
  echo get_page_template_slug(); 
  echo get_page_template() ;
?>

有什么方法可以在不关闭php的情况下将这两个echo语句打印在不同的行中,并使用html来换行

is there any way to print this two echo statements in different line with out closing php and use html to line break

平面php

<?php if ( 1 ==1 ) {
  echo 'first line';
  echo 'second line';
}

在所有情况下,两个回声值可能不是字符串

the two echo values might not be string in all cases

如何在echo语句后添加换行符,以便下一条语句在新行中显示

how to add line break after an echo statement, so that the next statement prints in new line

推荐答案

<?php if (is_page_template()) { 
  echo get_page_template_slug() . '</br>'; 
  echo get_page_template();
?>

尝试

这篇关于php,wordpress在两个echo语句中添加换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆