Home  >  Article  >  Backend Development  >  PHP code to check whether a number is odd or even

PHP code to check whether a number is odd or even

WBOY
WBOYOriginal
2016-07-25 08:57:103660browse
This article introduces a piece of code that uses PHP to determine odd and even numbers for your reference.

This article will share with you a PHP custom function, which is used to detect whether a number is odd or even, and return true or false. The code is very simple and suitable for beginners to refer to.

Code:

Call example:



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