SyntaxFix
Write A Post
Hire A Developer
Questions
This way you can create a new object with a custom property name.
$my_property = 'foo'; $value = 'bar'; $a = (object) array($my_property => $value);
Now you can reach it like:
echo $a->foo; //returns bar