|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
im puzzled. i use vbscript and c++ etc and they have enumerations. i can't find how to create an enum in php, does anyone have any ideas? i looked in the manual..no hope. i want something like this
var $myEnum {0 = 'red', 1 = 'blue', 2 = 'yellow'}; $d = new myEnum('blue'); i suppose i could use a class but its a waste if php does actually support enums. ![]() |
|
#2
|
|||
|
|||
|
Can you just use an array?
Consider: $myEnum = array ("red","blue","yellow"); $d = $myEnum[1]; |
|
#3
|
|||
|
|||
|
or maybe an associative array?
PHP Code:
I didn't see any direct references to enums in the PHP manual but I've never had much use for them... |
|
#4
|
|||
|
|||
|
i guess i could yeah...but im assuming that no one knows if php supports enums? if not its ok...an associative array will do. thanks guys
![]() |
|
#5
|
|||
|
|||
|
ENUM's don't exists in PHP. No real need for them, as PHP's arrays can pretty much handle the job.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > php and enumerations |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|