for loop without same $i digits?

Posted on 16th Feb 2014 by admin

Hi,

Can some guru please advise how can I accomplish this with a simple for loop ?

I want to use for loop to echo all number from 000 to 999
Quotefor($i=0;$i<1000;$i++)
{
echo "$i
";
}

My question is how can I skip the values that have the the same digits from displaying more than once ?

e.g 1)
001 displayed
and 101, 100 should not be displayed in the page anymore since it is the same value with different permutation

e.g 2)
127 displayed
and 217, 712, 172 and etc with the same digits should not be displayed.

Please advise how can I accomplish the above. Thanks

Other forums