So I am trying to target an object like this:
$subject = $obj->$field->{'$postID-subject'};
I always get a returned value of 0. Any thoughts?
So I am trying to target an object like this:
$subject = $obj->$field->{'$postID-subject'};
I always get a returned value of 0. Any thoughts?
Try that:
$field2 ="{$postID}-subject";
$subject = $obj->$field->$field2;
Proof of concept:
$a = new stdClass();
$a->{"A-A"} = 'B';
print $a->{"A-A"};
:)