How to convert Object into Array in PHP?By Hardik Savani | March 25, 2016 | | 810 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;
- How to Uninstall a Package in Laravel 5 Using Composer Command?
- Laravel 5 import export to excel and csv using maatwebsite example.
- Jquery - Show hide password in Password textbox using checkbox.
- Select only one checkbox at a time using Jquery
- How to get current url with parameters in Laravel 5?
- Codeigniter Angularjs http post not working
- Laravel 5 Pagination example