Posted by Willem on 10/03/05 10:33
Bosconian wrote:
> I have form values stored in an object.
I suppose you stored them in separate variables. It may be handier to
use an array for that.
When calling a method, you can pass the array index as a parameter.
>
> I have a set of numbered form fields:
>
> specialty1
> specialty2
> specialty3
>
> I need to loop through these, check for content and process accordingly. I
> can't figure out how to correctly concatenate the number to the end of the
> field name. For example:
>
> for ($i = 1; $i <= 3; $i++) {
> if (eval("$node->specialty" . $i)) {
> //do something
> }
> }
> I know eval is slow, but what other options are there?
>
> Thanks.
>
>
[Back to original message]
|