dongyao2001
dongyao2001
2017-05-24 13:36

找到两个在数组中相等的值

  • duplicates
  • php
  • arrays
 $arr = array(
     1, 1, 2, 3, 4
 );

How to find out the pair from this array ?
Keep in mind that the pair from array could be any number (1,2,4,3,2) or (3,3,1,2,4); I just give an random example above.

if there is a pair in array
   echo "The pair number is 1";
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

6条回答