1
2easy way to execute conditional html / javascript / css / other language code with php if else:
3
4<?php if (condition): ?>
5
6html code to run if condition is true
7
8<?php else: ?>
9
10html code to run if condition is false
11
12<?php endif ?>
13
14
1if ($a > $b) {
2 echo "a is bigger than b";
3} elseif ($a == $b) {
4 echo "a is equal to b";
5} else {
6 echo "a is smaller than b";
7}