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 trialRyley Ameden
134 PointsNew-ish to PHP. How can I do this better?
Hello Everyone,
I am loving Teamtreehouse and am learning a bunch. Recently I started to play around with PHP and am using it in a Wordpress environment combined with ACF (Advanced Custom Fields). I am working on a "page builder" or sorts and was hoping someone could take a look at a snippit of my code and tell me if I am doing this right, wrong, poorly, smartly... you get it.
The main section I am wondering if I am doing it correctly is when I push the width to the array. I don't want to have 3 different if statements to do this.
Thanks so much!