Opcode Descriptions and Examples
在线手册:中文 英文
PHP手册

MOD

PHP code

<?php
/*
 * Makes the value of "result" congruent to "value1" modulo "value2".
 * opcode number: 5
 */
echo 3;
?>

PHP opcodes

Function name: (null)

Compiled variables: none

line#op fetchextreturn operands
60 MOD   ~0 6,3
 1 ECHO     ~0
72 RETURN     1

Opcode Descriptions and Examples
在线手册:中文 英文
PHP手册
PHP手册 - N: MOD

用户评论:

shaunny at hotmail dot com (08-Jan-2010 02:35)

A simple check to see if a number is divisible by another number,
i.e. if a number is even.

<?php
if ($counter % 2) {
echo
"This number is not even.";
} else {
echo
"This number is even.";
}
?>