How php writes interface empty array returns object form
Editor to share with you how to write php interface empty array return object form, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's learn about it!
Write interface empty array returns object form
When $data is empty and strongly converted to object type, the value of json_encode is {}. If not, it is = = [] =. Whether you need to make a strong change to the actual situation.
$data = $data? $data: (object) the above $data; is all the contents of the article "how to write an empty array of interfaces to return an object form". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!