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 trialRobert Villareal
14,566 PointsDouble quotes and single quotes...
Why is the code below not using a combination of double quotes and single quotes?
<img src="<?php echo $product["img"]; ?>" alt="<?php echo $product["name"]; ?>" >
I thought it was supposed to be a combination of both when a quote already exist inside the code or text that's being quoted?
1 Answer
Adam Little
6,735 PointsIt's because the outside set of quotes are in HTML, and the inner sets of quotes are in PHP, so the rule doesn't apply.
Hope that helps.
Robert Villareal
14,566 PointsRobert Villareal
14,566 PointsThank you Adam.