Ec (2); thanks to bird for telling me how to use $ _ POST. The Code is as follows: & lt ;? Phpif ($ _ POST [perdata]) {$ _ POST [perdata] 1234;} $ datachop (trim ($ _ POST [perdata]); $ aexplode (, $ data); sort ($ a script ec (2); script
Thanks to bird for telling me how to use $ _ POST. The Code is as follows:
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 = 1;Do{?>
|
|
|
$ Num;}While (nextpermu ($ ));?>