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 trialsondus zatar
8,604 Points<ul> <?php for( $i = 0; $i < count($my plugin profile->courses); $i++ ): ?> <?php echo $WordPress Plugi
<ul> <?php for( $i = 0; $i < count($my plugin profile->courses); $i++ ): ?> <?php echo $WordPress Plugin Development->{'badges'}[$j]->{'name'}; ?> <?php endfor; ?> </ul>.
EDIT: Press edit and see what i did to achieve the highlighting on the code - Aurelian .
sondus zatar
8,604 Pointsi dont know what is the wrong in my answer
<?php
/*
{
"name": "Username",
"profile_name": "profile_username",
"profile_url": "http://myapi.net/profile_username"
"courses": [
{ "name": "WordPress Plugin Development" },
{ "name": "WordPress Theme Development" },
{ "name": "Introduction to PHP" }
]
}
*/
?>
<ul>
<?php for( $i = 0; $i < count($my_plugin_profile->courses); $i++ ): ?>
<li>
<?php echo $wp_plugin_profile->{'courses'}[$i]; ?>
</li>
<?php endfor; ?>
</ul>
```php
5 Answers
sondus zatar
8,604 Pointswhat is the problem in my code?
Aurelian Spodarec
7,369 PointsI don't know , I'm just to start learning PHP.
sondus zatar
8,604 Pointsagain , i tried this answer and not working
<?php
/* { "name": "Username", "profile_name": "profile_username", "profile_url": "http://myapi.net/profile_username" "courses": [ { "name": "WordPress Plugin Development" }, { "name": "WordPress Theme Development" }, { "name": "Introduction to PHP" } ] } */
?>
<ul>
<?php for( $i = 0; $i < count($my_plugin_profile->courses); $i++ ): ?>
<li>
<? php echo $WordPress Plugin Development-> {'badges"}[$iP]->{"name"}; ?></li>
<li> <? php echo $WordPress Theme Development-> {'badges"}[$iP]->{"name"}; ?></li>
<li> <? php echo $Introduction to PHP-> {'badges"}[$iP]->{"name"}; ?></li>
<?php endfor; ?> </ul>
Shai Yahav
7,153 Points<?php echo $my_plugin_profile->{'courses'}[$i]->{'name'}; ?>
sondus zatar
8,604 Pointsthanks Shai Yahav
Aurelian Spodarec
7,369 PointsI would recommend to take some PHP basics course .
Aurelian Spodarec
7,369 PointsAurelian Spodarec
7,369 PointsHi, whats your answer anyways? it seem you just posted only a code . You should explain and ask a question us in detail. Pasting a code don't help us really . I can assume you have an error but i don't know .