PHP update stdClass object

221 Views Asked by At

I am wanting to update a stdClass Object to set a value.

The object:

[info] => stdClass Object
    (
        [flags] => Array
            (
            )

I want to set the flags to this:

 [info] => stdClass Object
        (
            [flags] => Array
                (
                    [0] => ForceSSL
                )

I have tried

$response = $services_api->postWithFields("/package/$Package/web/", [
  

  'update' => (object) [
    'info' => [
            'flags'   => 'ForceSSL',
            ]
        ]
    ] );

var_dump( $response );

However, this shows a response of NULL - what am I doing wrong?

0

There are 0 best solutions below