Skip to content

Commit

Permalink
for文をforeachに書き換え
Browse files Browse the repository at this point in the history
  • Loading branch information
ue8d committed Nov 20, 2020
1 parent 5010e43 commit 1e2e8ff
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions function.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ function get_user_hidden_video_list($userId) {
$hiddenVideoPrepare->bindValue(':id', $userId, PDO::PARAM_STR);
$hiddenVideoPrepare->execute();
$hiddenVideoResult = $hiddenVideoPrepare->fetchAll(PDO::FETCH_ASSOC);
$hiddenVideoResultThumbId = array_column($hiddenVideoResult, "thumbId");

// リターン用配列の用意
$returnVideoList = array();
Expand All @@ -112,8 +111,8 @@ function get_user_hidden_video_list($userId) {

for ($i=0; $i < count($videoListResultId); $i++) {
$flag = false;
for ($j=0; $j < count($hiddenVideoResultThumbId); $j++) {
if ($videoListResultId[$i] == $hiddenVideoResultThumbId[$j]) {
foreach ($hiddenVideoResult as $hvr) {
if ($videoListResultId[$i] == $hvr) {
$flag = true;
break;
}
Expand Down

0 comments on commit 1e2e8ff

Please sign in to comment.