Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Build a Simple PHP Application Listing Inventory Items Displaying All Products

Array to string conversion errors

I get the above error when i write the complex products arrays and try to displaying it in the foreach loop. Do i have to do any casting before displaying?

Could you please copy and paste your code here so we can see what is wrong, would help alot more =].

3 Answers

How are you trying to display the array ?

Tom Mertz
Tom Mertz
15,254 Points

I remember getting this error, too. I don't remember how I fixed it though. It was something dumb, like forgetting to add ?> and close a php statement or something like that. I don't think casting is the solution.

It was was just a weird error. It started working after i started the Apache server. Thank you guys. I really appreciate your prompt response.