Find pair of n numbers in php
 Recently I was working on mobile project in which we were working on service code in php, To find the pair in certain number in list.     Example:                               $total = 4;   $pair_total = $total * ($total - 1) * 0.5; // 6       So here we are able to find the pair combination using this formula.And pls comment if there any tricks similar to this.