PHP получить цену
public static function getPercentPrice(int $price, int $percent): int
{
return ($price / 100) * $percent;
}
Shadow
public static function getPercentPrice(int $price, int $percent): int
{
return ($price / 100) * $percent;
}
<?php
$percentage = 50;
$totalWidth = 350;
$new_width = ($percentage / 100) * $totalWidth;
echo $new_width; // output 175
?>