Backend Development

Error with class array

Submitted by bVnDBsapg, , Thread ID: 97384

Thread Closed

RE: Error with class array

#2
I believe your error will be within the LoadPosts function. I believe you can only store stdObject and instantiated objects within an array.

I quick tip, I would be using a foreach loop to loop through the objects and not an iterator like you've got, i.e.

Code:
$posts = array([objects]);

foreach($posts as $key=>$post_object){

       $post_object->object_function();
       $posts[$key][change something in the original array] = [];

}

Users browsing this thread: 2 Guest(s)