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 trialBenjamin Intal
1,805 PointsAdd a return value to the displayDimensions method that returns these values as a string "length x width".
Add a return value to the displayDimensions method that returns these values as a string "length x width".
<?php
class Render {
public static function displayDimensions($size)
{
$size = array("length", "width");
return self::displayDimensions($size );
}
}
?>
1 Answer
Kieran Black
9,139 PointsHi Benjamin,
I believe on this one you only need to return the string based off the elements in the array, I think the clue is that the array is an indexed array and not an associative array based on the fact they mention the order.
Something like this should work:
<?php
class Render {
public static function displayDimensions($size) {
return $size[0].' x '. $size[1];
}
}
echo Render::displayDimensions($size);
?>
Hope that helps
KB