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;".
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!