Possible Duplicate:
PHP and Enums
I want to create a function with several parameters that one of them has several constant variable.
for example:
<?php
function print($str, $num){...}
.
.
.
print("omid",one);
print("omid",two);
?>
in this example $num consist of constant variable:”one,two, three”
Now, how to implement it? is there Enum in php?
thanks your time
There is no enum in php.
Just define your constants beforehand and then use them.
If you don’t want to define them as global constants (and you probably should not in this case), you can define them inside your class.
If constant you are trying to use was not defined then you will get an error