Home  >  Article  >  Backend Development  >  How to remove percent sign in php

How to remove percent sign in php

藏色散人
藏色散人Original
2021-10-19 10:05:572849browse

How to remove the percent sign in php: 1. Create a PHP sample file; 2. Define a percentage; 3. Remove the percent sign through "echo (float)$a/100;".

How to remove percent sign in php

The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer

How to remove the percent sign in php?

PHP percent sign to decimal

Code such as:

<?php  
  $a = "20.544545%";  
  echo (float)$a/100;  
?>

Related introduction:

Percent sign, the symbol is %. A symbol that represents an integer whose denominator is 100.

What it represents:

Divide a whole into 100 equal parts, and the number of parts occupied by one part is the expression method when the denominator of a fraction is 100, which can also be written as x/ 100.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to remove percent sign in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn