Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6764599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:36:46+00:00 2026-05-26T14:36:46+00:00

How can increase a number according to percent with PHP? For example: 100 +

  • 0

How can increase a number according to percent with PHP?

For example: 100 + 20% = 120 or 1367 + 33% = 1818.11

If output was this: 1818.11 i want only this: 1818 or this 12.32 = 12 or 546.98 = 546

How is it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:36:47+00:00Added an answer on May 26, 2026 at 2:36 pm

    I’m not sure if you’re looking for something deeper, but the answer seems fairly straightforward…

    $increasedValue = floor( $value * ( 1 + ( $percentageIncrease / 100 ) ) );
    

    If you wrapped that in a function, say increaseByPercentage( $value, $percentageIncrease ), you would get…

    increaseByPercentage( 100, 20 ); //returns 120
    increaseByPercentage( 1367, 33 ); //returns 1818
    

    Edit
    Based on your comment, I’m not sure what else you are looking for. PHP has 6 arithmetic operators:

    • Negation (-$a)
      -5 = -5

    • Addition ($a + $b)
      5 + 3 = 8

    • Subtraction ($a – $b)
      5 – 3 = 2

    • Multiplication ($a * $b)
      5 * 3 = 15

    • Division ($a / $b)
      5 / 3 = 1.667

    • Modulus ($a % $b)
      5 % 3 = 2

    If you write a line of code that says $a = 100 + 20%; it will not parse.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$('.fav').live('click', function(e){ $(this).toggleClass('highlight'); //increase the number by 1 html: <li class=fav light_gray_serif>5</li> how can
This isn't a question for a real-life project; I'm only curious. We can increase
This is what it says: You can use an incrementer to make a number
How can I increase the number of threads/concurrent requests per working process on IIS7?
I can increase the number of Worker Role (WR) instances directly from Java using
How can I increase an integer number in animate() on each click? For instance,
Can someone please elaborate the following related to strategy pattern: Strategies increase the number
I have input text and I want to increase the number that is inside
I have a really popular WP blog but I want to increase number of
Are there any algorithms or tools that can increase the resolution of an image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.