//当if子句的计算结果为false时,将显示textarea。/我需要改变什么?
<?php
if ( 1==2)
?>
<textarea>
"Add multiple lines of text here and watch the scrollbars grow.">
</textarea>
//当if子句的计算结果为false时,将显示textarea。/我需要改变什么?
<?php
if ( 1==2)
?>
<textarea>
"Add multiple lines of text here and watch the scrollbars grow.">
</textarea>
您可以使用打开/关闭括号这样做{}
<?php
if ( 1==2) {
?>
<textarea>
"Add multiple lines of text here and watch the scrollbars grow.">
</textarea>
<?php } ?>
一般来说,您需要将所有if else
语句使用php标记和外部的html。您也可以使用echo。<小时>
<?php if ( condition ) { ?>
<!-- your html goes here -->
<?php } else { ?>
<!-- another html goes here -->
<?php } ?>
使用echo的示例(使用ony-one-php标记打开/关闭块)<?php if ( condition ) {
echo "<p>Some text content</p>";
} else {
echo "<p>Another text content</p>";
} ?>
您没有完整的代码:
<?php
if ( 1==2): ?>
<textarea>
"Add multiple lines of text here and watch the scrollbars grow."
</textarea>
<?php endif; ?>
我目前对一种非常奇怪的行为感到失望,这种行为对我来说非常奇怪,即将php值回送到html表格单元格。我只想循环遍历一个数组并将值打印到一个表中,但在特殊条件下只显示一些信息。表外显示了这些值。<?php foreach ($mpbs_overview_tab4_bookings as $tab4_arr) { echo \"<tr>\"; $tab4startDate = new DateTime($tab4_arr->starttime);