Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions php-practice_1.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,10 @@
// 但し、ifとelseのみを使用して処理を作成してください。(elseif は使わないでください)
<?php
$device = "mac";
if ($device == "windows") {
echo "使用OSは、windowsです。";
if ($device === "windows"|| $device === "mac") {
echo "使用OSは、$device です。";
} else {
if ($device == "mac") {
echo "使用OSは、macです。";
} else {
echo "どちらでもありません。";
}
echo "どちらでもありません。";
}
?>

Expand Down Expand Up @@ -208,7 +204,7 @@ function calcTaxInPrice($price) {
// 奇数と偶数それぞれを渡して実行して、結果を表示してください。
<?php
function distinguishNum($num) {
if ($num % 2 == 0) {
if ($num % 2 === 0) {
return $num . "は偶数です。";
} else {
return $num . "は奇数です。";
Expand Down
241 changes: 0 additions & 241 deletions php-practice_2.php

This file was deleted.