The usage syntax of the PHP function sizeof () is described in detail. The sizeof () syntax of the PHP function: sizeof (arrayname); prompt and description Note: This function may return 0. if a variable is not set, it may also return 0, ifSyntax of the PHP function sizeof:
Sizeof (arrayname );
Tips and instructions
Note: This function may return 0. if a variable is not set, but it may also return 0, if a variable contains an empty array. This isset () function can be used to test whether a variable is set.
Let's take a look at the sizeof () instance of the PHP function.
- php
- $people = array("a", "Joe", "b", "C");
- $result = sizeof($people);
-
- echo $result;
- ?>
Output result: 4
From the above example, we can see that the sizeof () function of PHP is the same as the count method.
Syntax of the semi PHP function sizeof (): sizeof (arrayname); prompt and description Note: This function may return 0. if a variable is not set, it may also return 0, if...