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 trialRaslan Ismail
10,262 Pointsi got this message can somebody help me "It looks like Task 1 is no longer passing."
$colors = array("Red","Green","Blue"); array_unshift($colors,"Yellow"); array_push($colors,"Black");
<?php
$colors = array("Red","Green","Blue");
array_unshift($colors,"Yellow");
array_push($colors,"Black");
array_replace($colors,1=>"Magenta",3=>"Cyan");
Raslan Ismail
10,262 PointsThank you, it works
Juan Gonzalez
12,960 PointsJuan Gonzalez
12,960 PointsI think it is because you are having an php error 'cause you are using the array_replace function wrong, it need to have at least 2 arrays the base one, in this case it would be the $colors array and the replace array who would be something like array( 1 => "magenta", 3=>"Cyan" ) and also, you arent asigning the value of the function to anything, so you code should look like this
but I think there is also another option where you can change the values directly providing the array index like this
and this would help you pass this step, in the last one you just need to unset a value hope it helps!