The instructions for the php for pulldown menus in CCK say:
"PHP code that returns a keyed array of allowed values. Should not include delimiters."

I have used php before. I have written php scripts that do what I want for use in html forms. But I learned to do that sort of thing by analysing and altering existing code. As a result my vocabularly is lacking, and I'm not finding these instructions terribly instructive.

Simply removing the dilinators from my existing scripts doesn't work. (I didn't think they would; the echo statments quite clearly are *not* what is called for. But I didn't like to ask for help until I had at least tried something on my own.)

If someone would post me a quick example of a working pulldown menu code, I would be very grateful. It doesn't have to be anything fancy -- it's the format I need to understand, I can do the function type stuff myself. :)

Comments

codrai’s picture

Example

$Values = array (1 => One, 2 => Two, 3 => Three, 4 => Four);
return $Values;

toul’s picture

...any ideas. i want a classical html pulldown menu with some tags. but i dont know how to do this.
the taxonomy example (as a php code snippet) ist not working.
so please post some ideas.