title: PHP - Convert stdClass Object as String to Array
body: <p>i've a peace of code that catch an Exception. 
  I get the error body with $e->getMessage()
  and the result is the following string.
  Now i want to access to customer_email
  how can i do this?</p>
  
  <p>i receive this responde from Stripe API Request </p>
  
  <pre><code>stdClass Object
  (
      [error] =&gt; stdClass Object
          (
              [charge] =&gt; ch_1F1UTrAMXDCOYAqpNzJLKFff
              [code] =&gt; card_declined
              [message] =&gt; Your card was declined.
              [payment_intent] =&gt; stdClass Object
                  (
                      [id] =&gt; pi_1F1IwGAMXDCOYAqpSwoFHsN1
                      [amount_capturable] =&gt; 0
                      [metadata] =&gt; stdClass Object
                          (
                              [customer_name] =&gt; C B
                              [customer_email] =&gt; pippo@gmail.com
                              [order_id] =&gt; 363
                          )
                      [payment_method_options] =&gt; stdClass Object
                          (
                              [card] =&gt; stdClass Object
                                  (
                                      [request_three_d_secure] =&gt; automatic
                                  )
                          )
                      [payment_method_types] =&gt; Array
                          (
                              [0] =&gt; card
                          )
                      [receipt_email] =&gt; 
                      [review] =&gt; 
                  )
              [source] =&gt; stdClass Object
                  (
                      [id] =&gt; src_1F1UTnAMXDCOYAqpYOtW3GyR
                      [object] =&gt; source
                      [card] =&gt; stdClass Object
                          (
                              [exp_month] =&gt; 12
                              [exp_year] =&gt; 2020
                              [last4] =&gt; 9987
                              [country] =&gt; US
                          )
                      [client_secret] =&gt; src_client_secret_FWXYzYw3vPwPe4CzyveJdVMP
                      [created] =&gt; 1564389915
                      [flow] =&gt; none
                      [metadata] =&gt; stdClass Object
                          (
                          )
                          )
                  [type] =&gt; card_error
              )
  
      )
  </code></pre>