Total number of items defined in an enum in PHP
Example 1
var myEnumMemberCount = Enum.GetNames(typeof(MyEnum)).Length;
Example 2
enum MyEnum
{
A = 1,
B = 2,
C = 1,
D = 3,
E = 2
}
var myEnumMemberCount = Enum.GetNames(typeof(MyEnum)).Length;
enum MyEnum
{
A = 1,
B = 2,
C = 1,
D = 3,
E = 2
}
In this page (written and validated by A. Gawali) you learned about . What's Next? If you are interested in completing PHP tutorial, we encourage you simply to start here: PHP Tutorial.
Share On: |