PHP implements the lexicographic sorting algorithm .? Phpif ($ _ POST [perdata]) {$ _ POST [perdata] 1234;} $ datachop (trim ($ _ POST [perdata]); $ aexplode (, $ data); sort ($ a); $ dataimplode (, $ );?? Phpfunctionnex If ($ _ POST ["perdata"] = "")
{
$ _ POST ["perdata"] = "1 2 3 4 ";
}
$ Data = chop (trim ($ _ POST ["perdata"]);
$ A = explode ("", $ data );
Sort ($ );
$ Data = implode ("", $ );
?>
Function nextpermu (& $ c)
{
$ S = sizeof ($ c );
$ I = $ s-1;
While ($ I> 0)
{
If ($ c [$ I]> $ c [$ i-1])
{
$ J = $ S-1;
While ($ c [$ j] <= $ c [$ i-1])
$ J --;
$ T = $ c [$ i-1];
$ C [$ i-1] = $ c [$ j];
$ C [$ j] = $ t;
// Echo $ I. "-". $ j ."
";
For ($ j = $ S-1; $ I <$ j; $ I, $ j --)
{
$ T = $ c [$ I];
$ C [$ I] = $ c [$ j];
$ C [$ j] = $ t;
}
Return true;
}
$ I --;
}
For ($ I = 0, $ j = $ S-1; $ I <$ j; $ I, $ j --)
{
$ T = $ c [$ I];
$ C [$ I] = $ c [$ j];
$ C [$ j] = $ t;
}
Return false;
}
?>
Arrangement-Dictionary
Current element:
| Serial Number |
Arrange |
| |
|
$ Num;}While (nextpermu ($ ));?>
Http://www.bkjia.com/PHPjc/631405.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631405.htmlTechArticle? Php if ($ _ POST [perdata] =) {$ _ POST [perdata] = 1 2 3 4 ;} $ data = chop (trim ($ _ POST [perdata]); $ a = explode (, $ data); sort ($ a); $ data = implode (, $ );? ? Php function nex...