How to build the design?

There are design
$var = $meta -> val3;
If you write
$i=3;
$a='val'.$i;
$var = $meta -> $a;

It all works.
And how to do without the intermediate variable $a?
i.e. how to build the expression of the val3 (using the value of the variable $i=3) directly into design $meta -> ??
June 27th 19 at 15:15
2 answers
June 27th 19 at 15:17
Solution
$meta->{'val' . '3'}
variables can be used?
$meta->{'val' . $i} - Talia_Weber commented on June 27th 19 at 15:20
Can - Barrett.Little commented on June 27th 19 at 15:23
June 27th 19 at 15:19
Solution

Find more questions by tags PHP