note 126783 added to function.sort
| From: | user_998 at main dot php dot net | Date: | Thu, 20 Jan 2022 15:29:18 +0000 |
| Subject: | note 126783 added to function.sort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217522@lists.php.net to get a copy of this message | ||
function machine_nombres(int $a)
{
// convertir le nombre et ordonner
$croissant = str_split(strval($a));
$decroissant = str_split(strval($a));
sort($croissant, SORT_NUMERIC);
// ordre decroissant
rsort($decroissant, SORT_NUMERIC);
// Reconstruction de nombre
$acroissant = intval(implode('', $croissant));
$adecroissant = intval(implode('', $decroissant));
//retourner la différence
return $adecroissant - $acroissant;
}
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.135 (proxied: 46.193.4.86)
----
Manual Page -- https://php.net/manual/en/function.sort.php
Edit -- https://main.php.net/note/edit/126783
Del: integrated -- https://main.php.net/note/delete/126783/integrated
Del: useless -- https://main.php.net/note/delete/126783/useless
Del: bad code -- https://main.php.net/note/delete/126783/bad+code
Del: spam -- https://main.php.net/note/delete/126783/spam
Del: non-english -- https://main.php.net/note/delete/126783/non-english
Del: in docs -- https://main.php.net/note/delete/126783/in+docs
Del: other reasons-- https://main.php.net/note/delete/126783
Reject -- https://main.php.net/note/reject/126783
Search -- https://main.php.net/manage/user-notes.php