Skip to content

How to add attributes to an object in PHP?

$foo = (array)$foo;
$foo['bar'] = '1234';
$foo = (object)$foo;
See also  Python code snippet - How to set route from different file in flask?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.