Code of the rounding function in php (floor function, ceil function, round and intval), ceilintval. The rounding function code (floor function, ceil function, round and intval) in php can be used together with ceilintvalfloor function and ceil
Code of the rounding function in php (floor function, ceil function, round and intval), ceilintval
The combination of the floor function and the ceil function makes the data processed by php more authentic and reliable.
I. First, let's look at the
No matter what type of data is, a number is returned. if it is not a number, 0 is returned. when $ _ GET [id] is used in PHP, a conversion can be done like this... great.
PHP code$ Id = intval ($ _ GET ['id']);
Intval(PHP 4, PHP 5)
Intval-Get the
As early as a few years before SQL injection went viral, string conversion into integers has been listed as a required operation for every web program. The web program forcibly converts the id and integer equivalent values from get or post into
PHPCode $ Id = intval ($ _ Get ['id']);
Intval (PHP 4, PHP 5)
Intval-get the integer value of a Variable
Description
Int intval (mixed $ var [, int $ base = 10])
Returns the integer value of VaR, using the specified base for the conversion
Background, overviewAs early as the SQL injection rampage, the string converted to integers has been listed as a prerequisite for every Web application. The Web program converts the ID, integer equivalent of Get or post to an integer, filters out
As early as a few years before SQL injection went viral, string conversion into integers has been listed as a required operation for every web program. The web program forcibly converts the id and integer equivalent values from get or post into
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.