Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php calculate percentage

$percentage = 50;
$totalWidth = 350;

$new_width = ($percentage / 100) * $totalWidth;
Comment

increase the number in php by a certain percentage

$price = $price + ($percentage / 100 ) * $price
Comment

percentage in php

<?php
// How much is the x percentage of given value

$percentage = 10;
$totalValue = 500;

// 10% of 500
echo $newValue = ($percentage*$totalValue)/100;
Comment

PHP program to Calculate Percentage

// defining function
 function calPercentage($num, $total) {
  $count1 = $num_amount / $num_total;
  $count2 = $count1 * 100;
  $count = number_format($count2, 0);
  return $count;
}

// call function to calculate percentage
echo "Percentage of 100 in 1000 = ".calPercentage(100, 1000).'%<br/>';
echo "Percentage of 26 in 200 = ".calPercentage(26, 200).'%<br/>';
echo "Percentage of 30 in 400 = ".cal_percentage(30, 400).'%<br/>';

Output 
Percentage of 100 in 1000 = 10%
Percentage of 26 in 200 = 13%
Percentage of 30 in 400 = 8%
Comment

calculate percentage of amount in php

//ENTER  PERCENT AND AMOUNT 
//IT WILL RETURN OUTPUT
//INTAKE: 2% OF 10
//OUTPUT : 0.2
function calc_percent($percent, $amt) {
  return  $output = ($per/100 * $amt);
}
Comment

percentage in php

$percentage = 10; //persentage
$totalWidth = 1000; //Summa

$new_width = ($percentage / 100) * $totalWidth;
Comment

PREVIOUS NEXT
Code Example
Php :: Check duplicate email using Jquery validation 
Php :: ext-dom php 7.2 
Php :: laravel grouping routes 
Php :: php get age from dob 
Php :: php Access-Control-Allow-Origin 
Php :: get logged in user name yii2 
Php :: laravel enum migration 
Php :: clear file contents php 
Php :: laravel carbon get month number 
Php :: Date and Time PHP Continued 
Php :: php add days to date 
Php :: excerpt length wordpress 
Php :: PHP array_sum() Function 
Php :: how can we use two php version in mac os 
Php :: woocommerce my account url 
Php :: check if post id exists wordpress 
Php :: laravel date validation 
Php :: remove slashes from json php 
Php :: php reporting wrong time 
Php :: display rows brought back by query php 
Php :: print value in laravel console 
Php :: symfony call another controller 
Php :: wordpress acf get checkbox options 
Php :: checks input if number only in php 
Php :: laravel modules slowdown 
Php :: php remove class attribute 
Php :: laravel custom error page 
Php :: kill laravel server 
Php :: encryp with codeigniter 3 
Php :: php get prameter 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =