How to remove percent sign in php

藏色散人
Release: 2023-03-13 11:50:02
Original
2832 people have browsed it

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;  
?>
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!