Quote:
Originally Posted by ownedbycats
How is switch() meant to be used? Here, I got overdrive.png when I was expecting drm-locked.png, so I think I either
a) misunderstood the syntax
b) misunderstood what instances it's meant to be used in:
|
You misunderstand the syntax. The first argument is a value, perhaps a $column selector. The rest of the arguments are (pattern, value) pairs. The pattern is checked against the first argument. If it matches then the value is returned.
The syntax you are using is switch_if().