How to convert Object into Array in PHP?By Hardik Savani | March 25, 2016 | | 694 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;
- Laravel 5 Repository Pattern Tutorial from scratch
- Laravel 5 - How to implement gravatar image using thomaswelton/laravel-gravatar package
- PHP: How to count files in folder?
- How to solve - you dont have permission to upload files in KCFinder ?
- Laravel 5.3 - import export csv and excel file into database
- Jquery notification popup box example using toastr JS plugin with demo
- Laravel 5 - How to get route parameters in your route middleware?
- PHP Image upload without refreshing page using jquery example