How to implement further method in php

WBOY
Release: 2023-03-15 22:22:02
Original
2699 people have browsed it

In PHP, you can use the ceil() function to implement the further method. This function is used to round up to the nearest integer, that is, round up to an integer and return the next value that is not less than the specified value. Integer, if the specified value has a decimal part, it will be rounded up by one digit. The syntax is "ceil(number);".

How to implement further method in php

The operating environment of this article: Windows 10 system, PHP version 7.1, Dell G3 computer

How to implement the next method in php

## The #ceil() function rounds up to the nearest integer.

Syntax

ceil(number);
Copy after login

number Required. Specifies the value to be rounded up.

Returns the next integer that is not less than number. If number has a decimal part, it is rounded up by one. The type returned by ceil() is still float because the range of float values ​​is usually larger than that of integer.

Examples are as follows:


<?php
echo(ceil(0.60);
echo(ceil(0.40);
echo(ceil(5);
echo(ceil(5.1);
echo(ceil(-5.1);
echo(ceil(-5.9));
?>
Copy after login

Output results:

How to implement further method in php## Recommended learning: "

PHP Video Tutorial

The above is the detailed content of How to implement further method 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!