Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$state_point_array = [
"Tehran" => "8400",
"Qazwin" => "4960",
"Fars" => "1600",
"Booshehr" => "1600",
"Khorasan" => "1600",
"Bandar" => "1080"
];
$points = array_unique(array_values($state_point_array), SORT_NUMERIC);
rsort($points);
foreach ($state_point_array as $state => $point) {
$index = array_search($point, $points) + 1;
printf("%d | %s | %d \n", $index, $state, $point);
}