У меня есть php код ниже, я хочу это сделать Я хочу хранить просмотры в mysql db в 1000 = 1k, 100000 = 100k, 1000000 = 1M и так далее, так что кто-нибудь может сказать мне, как я могу сделать это
function updateVideoView()
{
require_once("config.php");
$input = @file_get_contents("php://input");
$event_json = json_decode($input,true);
//print_r($event_json);
if(isset($event_json['id']))
{
$id=htmlspecialchars(strip_tags($event_json['id'] , ENT_QUOTES));
mysqli_query($conn,"update videos SET view =view+1 WHERE id ='".$id."' ");
$array_out[] =
array(
"response" =>"success");
$output=array( "code" => "200", "msg" => $array_out);
print_r(json_encode($output, true));
}
else
{
$array_out = array();
$array_out[] =
array(
"response" =>"Json Parem are missing");
$output=array( "code" => "201", "msg" => $array_out);
print_r(json_encode($output, true));
}
}