Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
dvprog_02 [2019-12-06 16:08] Daniel Viström |
dvprog_02 [2020-09-03 13:07] Daniel Viström |
||
---|---|---|---|
Line 36: | Line 36: | ||
echo '< | echo '< | ||
echo '< | echo '< | ||
- | $name1 = '4Bertil'; | + | $name1 = 'Bertil'; |
- | $name2 = '3Stina'; | + | $name2 = 'Stina'; |
$tal1 = 5; // integer (heltal) | $tal1 = 5; // integer (heltal) | ||
$tal2 = 7; | $tal2 = 7; | ||
Line 44: | Line 44: | ||
echo '< | echo '< | ||
echo $name1 . ' & ' . $name2 . '< | echo $name1 . ' & ' . $name2 . '< | ||
- | echo $name1 + $name2; | ||
- | echo '< | ||
$tal1 + $tal2; | $tal1 + $tal2; | ||
Line 78: | Line 76: | ||
| | ||
// && betyder " | // && betyder " | ||
- | if ($name1 == '4Bertil' && $name2 == '3Stina') { | + | if ($name1 == 'Bertil' && $name2 == 'Stina') { |
echo 'Båda villkoren är sanna.< | echo 'Båda villkoren är sanna.< | ||
} | } | ||
Line 90: | Line 88: | ||
if (!($tal1 == 6)){ // Blir samma som: if ($tal1 != 6){ | if (!($tal1 == 6)){ // Blir samma som: if ($tal1 != 6){ | ||
echo 'Talet är inte 6< | echo 'Talet är inte 6< | ||
+ | } | ||
+ | |||
+ | if ($tal1 == 100) { | ||
+ | echo ' | ||
+ | } else { // else = " | ||
+ | echo 'Inte 100< | ||
} | } | ||