0

I have an array $data['result'] ,and I can access it by $data['result'] , I want to access the array inside the result array called items and then again the items array inside that items array. Please help. snapshot

1 Answer 1

1

$data['result'] is a LengthAwarePaginator.

The first items child is a Collection representing the slice of data being paginated.

The items in the Collection is the array of items represented by the Collection.

You can access this array from the paginator using the items() method.

$collectionItems = $data['result']->items();
Sign up to request clarification or add additional context in comments.

3 Comments

can you tell me how to empty that items and assign another array variable,
@Rox You will need to ask another question, showing any relevant code and what you'd like to do.
please help me , $data['result']->items() have some array , which i want to clear and i have another array which I want to assign to $['result']->items()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.