Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Coding Correction 1 (M. Hafidz Fadillah - XI RPL 2)</title>
- </head>
- <body>
- <h2>Pakai Ternary:<br>
- <?php
- $nilai = 85;
- $hasil = ($nilai > 70 ? "baik" : "buruk");
- echo "hasilnya adalah $hasil dengan bilangan $nilai";
- //hasil baik
- ?>
- </h2>
- <h3>Tanpa Ternary:<br>
- <?php
- $nilai = 85;
- if ($nilai = 85) {
- echo 'baik';
- }
- else {
- echo 'buruk';
- }
- ?>
- </h3>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement