stdclass to array

Working with Files in PHP (The Brief Way)

Files are essential to large scale web applications. Wherever we have some kind of resource management and planning, the idea to log changes and variations or create reports it’s crucial for providing optimal insight to sales, accounting and managing departments. Even from the developers’ perspective, being able to generate CSV or JSON files on demand for various purposes, will speed up development and boost productivity, leading to more features for other departments to leverage. PHP offers an very robust way...

Continue reading...

How to create a JSON Object in PHP?

JSON or JavaScript Object Notation is a powerful format that’s been used mainly whenever we need to include some kind of dynamic data fetching within our website, using JavaScript. It’s the ideal format when working and communicating with application programming interfaces. To create a JSON object in PHP you simply call the json_encode() function by passing an array of your choice as parameter. For instance, suppose we have an array of objects that contain an id and a label.$arr =...

Continue reading...

What is stdClass in PHP?

As a developer, when you code web applications and especially large scaled ones, you are going to use the notion of the object at some point. All those conventional data structures may not cut it depending the use case and the issue that you are trying to solve. That is why at some point you may need to create your own data structure with the properties of your choice that are going to match your needs perfectly. You can achieve...

Continue reading...