How to convert Object into Array in PHP?By Hardik Savani | March 25, 2016 | | 913 Viewer | Category : PHP
Share this post:
Whenever you need to convert object to array in your php project then you can do that using (array). It is a pretty simple example to convert php object into array that way you can use array. So, let's see the following example.
$myObject = new MyClass;
$myObject->id = 100;
$myObject->title = "posts";
$myObject->description = "this is posts";
$newArray = (array) $myObject;
- PHP - autocomplete websites with domain and logo using clearbit API
- Multiple database connections in laravel 5 Application
- Select only one checkbox at a time using Jquery
- Laravel where clause with date_format() example
- How to change view mode in bootstrap datepicker like yyyy-mm?
- Laravel 5 mailchimp api integration from scratch with example
- AngularJS - How to Limit String Length using Filter?
- Laravel 5 - Generate Captcha code and Validation example using BotDetect package