teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

修正

2019/03/27 07:44

投稿

m.ts10806
m.ts10806

スコア80888

answer CHANGED
@@ -1,14 +1,10 @@
1
1
  出現1回のみなら何でも良いというのでしたら
2
2
  ```php
3
3
  $check = ['abc','efg'];
4
- $result = false;
5
4
  foreach($check as $word){
6
5
  if($cat_slug === $word){
7
- $result = true;
6
+ echo '記事を公開しました。';
8
7
  break;
9
8
  }
10
9
  }
11
- if($result){
12
- echo '記事を公開しました。';
13
- }
14
10
  ```