Php如果endif

代码示例

13
0

php如果elseif

$a = random_int(0, 10);
$b = random_int(0, 10);
if ($a > $b) {
  echo 'a is greater than b';
} elseif ($a == $b) {
  echo 'a is equal to b';
} else {
  echo 'a is less than b';
}
1
0

php endif


  <?php
$a = 4;
if($a < 5):
  echo "Less than five";
endif;
?> 
0
0

php如果endif

#1
if ($var1 == true) {
  // codice da eseguire
} else if ($var2 == true) {
  // codice da eseguire
} else {
  // codice da eseguire
}
# 2
<?php if ($var1 == true): ?>
  // codice da eseguire
<?php elseif ($var2 == true): ?>
  // codice da eseguire
<?php else: ?>
  // codice da eseguire
<?php endif; ?>
0
0

php结束if

<?php
	if (something):
		echo "something";
	endif;
?>

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................