Good afternoon guys. There is an array, let's call it UserArticleList , here is its vardamp:
array(2) { [0]=> string(1) "1" [1]=> string(1) "2" } There is such a piece of code:
foreach($ArticleList as $article){ if(array_search($article['id'],$UserArticleList)){ continue; //Продолжаем обрабатывать запись } Here the loop $ArticleListas all the records in the $ArticleListas ( $ArticleListas ). If the id current record is in the array, then go to the next iteration of the loop. And everything should work, but array_search finds only an element with a value of 2 . Why?)