title: Parsing WordPress stdClass Data In PHP
body: <p>I executed a query in PHP to retrieve data from <code>wp_options</code> in my WordPress database table.</p>
  
  <p>The output is as follows: </p>
  
  <pre><code>O:8:"stdClass":4:{s:12:"last_checked";i:1517323099;s:8:"response";a:0:{}s:12:"translations";a:0:{}s:9:"no_update";a:3:{s:19:"akismet/akismet.php";O:8:"stdClass":9:{s:2:"id";s:21:"w.org/plugins/akismet";s:4:"slug";s:7:"akismet";s:6:"plugin";s:19:"akismet/akismet.php";s:11:"new_version";s:5:"4.0.2";s:3:"url";s:38:"https://wordpress.org/plugins/akismet/";s:7:"package";s:56:"https://downloads.wordpress.org/plugin/akismet.4.0.2.zip";s:5:"icons";a:3:{s:2:"1x";s:59:"https://ps.w.org/akismet/assets/icon-128x128.png?rev=969272";s:2:"2x";s:59:"https://ps.w.org/akismet/assets/icon-256x256.png?rev=969272";s:7:"default";s:59:"https://ps.w.org/akismet/assets/icon-256x256.png?rev=969272";}s:7:"banners";a:2:{s:2:"1x";s:61:"https://ps.w.org/akismet/assets/banner-772x250.jpg?rev=479904";s:7:"default";s:61:"https://ps.w.org/akismet/assets/banner-772x250.jpg?rev=479904";}s:11:"banners_rtl";a:0:{}}s:9:"hello.php";O:8:"stdClass":9:{s:2:"id";s:25:"w.org/plugins/hello-dolly";s:4:"slug";s:11:"hello-dolly";s:6:"plugin";s:9:"hello.php";s:11:"new_version";s:3:"1.6";s:3:"url";s:42:"https://wordpress.org/plugins/hello-dolly/";s:7:"package";s:58:"https://downloads.wordpress.org/plugin/hello-dolly.1.6.zip";s:5:"icons";a:3:{s:2:"1x";s:63:"https://ps.w.org/hello-dolly/assets/icon-128x128.jpg?rev=969907";s:2:"2x";s:63:"https://ps.w.org/hello-dolly/assets/icon-256x256.jpg?rev=969907";s:7:"default";s:63:"https://ps.w.org/hello-dolly/assets/icon-256x256.jpg?rev=969907";}s:7:"banners";a:2:{s:2:"1x";s:65:"https://ps.w.org/hello-dolly/assets/banner-772x250.png?rev=478342";s:7:"default";s:65:"https://ps.w.org/hello-dolly/assets/banner-772x250.png?rev=478342";}s:11:"banners_rtl";a:0:{}}s:19:"jetpack/jetpack.php";O:8:"stdClass":9:{s:2:"id";s:21:"w.org/plugins/jetpack";s:4:"slug";s:7:"jetpack";s:6:"plugin";s:19:"jetpack/jetpack.php";s:11:"new_version";s:5:"5.7.1";s:3:"url";s:38:"https://wordpress.org/plugins/jetpack/";s:7:"package";s:56:"https://downloads.wordpress.org/plugin/jetpack.5.7.1.zip";s:5:"icons";a:4:{s:2:"1x";s:60:"https://ps.w.org/jetpack/assets/icon-128x128.png?rev=1791404";s:2:"2x";s:60:"https://ps.w.org/jetpack/assets/icon-256x256.png?rev=1791404";s:3:"svg";s:52:"https://ps.w.org/jetpack/assets/icon.svg?rev=1791404";s:7:"default";s:52:"https://ps.w.org/jetpack/assets/icon.svg?rev=1791404";}s:7:"banners";a:3:{s:2:"2x";s:63:"https://ps.w.org/jetpack/assets/banner-1544x500.png?rev=1791404";s:2:"1x";s:62:"https://ps.w.org/jetpack/assets/banner-772x250.png?rev=1791404";s:7:"default";s:63:"https://ps.w.org/jetpack/assets/banner-1544x500.png?rev=1791404";}s:11:"banners_rtl";a:0:{}}}}
  </code></pre>
  
  <p>Here's the formatted data that I unserialized from the initial output above: </p>
  
  <pre><code>stdClass Object
  (
      [last_checked] =&gt; 1517323099
      [response] =&gt; Array
          (
          )
  
      [translations] =&gt; Array
          (
          )
  
      [no_update] =&gt; Array
          (
              [akismet/akismet.php] =&gt; stdClass Object
                  (
                      [id] =&gt; w.org/plugins/akismet
                      [slug] =&gt; akismet
                      [plugin] =&gt; akismet/akismet.php
                      [new_version] =&gt; 4.0.2
                      [url] =&gt; https://wordpress.org/plugins/akismet/
                      [package] =&gt; https://downloads.wordpress.org/plugin/akismet.4.0.2.zip
                      [icons] =&gt; Array
                          (
                              [1x] =&gt; https://ps.w.org/akismet/assets/icon-128x128.png?rev=969272
                              [2x] =&gt; https://ps.w.org/akismet/assets/icon-256x256.png?rev=969272
                              [default] =&gt; https://ps.w.org/akismet/assets/icon-256x256.png?rev=969272
                          )
  
                      [banners] =&gt; Array
                          (
                              [1x] =&gt; https://ps.w.org/akismet/assets/banner-772x250.jpg?rev=479904
                              [default] =&gt; https://ps.w.org/akismet/assets/banner-772x250.jpg?rev=479904
                          )
  
                      [banners_rtl] =&gt; Array
                          (
                          )
  
                  )
  
              [hello.php] =&gt; stdClass Object
                  (
                      [id] =&gt; w.org/plugins/hello-dolly
                      [slug] =&gt; hello-dolly
                      [plugin] =&gt; hello.php
                      [new_version] =&gt; 1.6
                      [url] =&gt; https://wordpress.org/plugins/hello-dolly/
                      [package] =&gt; https://downloads.wordpress.org/plugin/hello-dolly.1.6.zip
                      [icons] =&gt; Array
                          (
                              [1x] =&gt; https://ps.w.org/hello-dolly/assets/icon-128x128.jpg?rev=969907
                              [2x] =&gt; https://ps.w.org/hello-dolly/assets/icon-256x256.jpg?rev=969907
                              [default] =&gt; https://ps.w.org/hello-dolly/assets/icon-256x256.jpg?rev=969907
                          )
  
                      [banners] =&gt; Array
                          (
                              [1x] =&gt; https://ps.w.org/hello-dolly/assets/banner-772x250.png?rev=478342
                              [default] =&gt; https://ps.w.org/hello-dolly/assets/banner-772x250.png?rev=478342
                          )
  
                      [banners_rtl] =&gt; Array
                          (
                          )
  
                  )
  
              [jetpack/jetpack.php] =&gt; stdClass Object
                  (
                      [id] =&gt; w.org/plugins/jetpack
                      [slug] =&gt; jetpack
                      [plugin] =&gt; jetpack/jetpack.php
                      [new_version] =&gt; 5.7.1
                      [url] =&gt; https://wordpress.org/plugins/jetpack/
                      [package] =&gt; https://downloads.wordpress.org/plugin/jetpack.5.7.1.zip
                      [icons] =&gt; Array
                          (
                              [1x] =&gt; https://ps.w.org/jetpack/assets/icon-128x128.png?rev=1791404
                              [2x] =&gt; https://ps.w.org/jetpack/assets/icon-256x256.png?rev=1791404
                              [svg] =&gt; https://ps.w.org/jetpack/assets/icon.svg?rev=1791404
                              [default] =&gt; https://ps.w.org/jetpack/assets/icon.svg?rev=1791404
                          )
  
                      [banners] =&gt; Array
                          (
                              [2x] =&gt; https://ps.w.org/jetpack/assets/banner-1544x500.png?rev=1791404
                              [1x] =&gt; https://ps.w.org/jetpack/assets/banner-772x250.png?rev=1791404
                              [default] =&gt; https://ps.w.org/jetpack/assets/banner-1544x500.png?rev=1791404
                          )
  
                      [banners_rtl] =&gt; Array
                          (
                          )
  
                  )
  
          )
  
  )
  </code></pre>
  
  <p>I am looking to parse the data to get the <code>slug</code> value, but I'm not sure how to best parse an <code>stdClass</code> object.  Any assistance would be appreciated. </p>