XF 2.1 How to say: $car->$trick[$i]

Robert9

Well-known member
Till now i had something like
$car->color
$car->age
$car->weight

but i want to work with an index like

$car->$trick[$i]

and this is a "Array to string conversion".

I can do

trick[0] =$car->color
trick[1] =$car->age
trick[2] =$car->weight
...
trick[99] =$car->price

but the idea is only to touch what i need.
And for this i need integers to say': care only for 12 till 22;

Any idea how to say this in php, please?
 
Top Bottom