PHP program to generate permutations with only one swap allowed .
< ? php function findPermutations ( $ str , $ index , $ n ) { if ( $ index >= $ n || ( $ index + 1 ) >= $ n ) { echo $ str , " STRNEWLINE " ; return ; }