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 trial

PHP

Mohammad Rifqi
PLUS
Mohammad Rifqi
Courses Plus Student 3,218 Points

how to echo this interface > array?

<?php interface rideable { public function howtoride(); }

class skateboard implements rideable { public function howtoride(){

$step = array():
$step[] = "Balance your front foot on the board.";
$step[] = "Kick, then push with the other foot.";
$step[] = "Don't fall down!";
return $step;

} } // this not work.... $p = new skateboard(); echo $p->howtoride(); ?>

1 Answer

u are calling a method which returns an array.

you cannot view the contents in an array using the "echo" command.

use

<?php

print_r($p->howtoride()); 

?>
Mohammad Rifqi
Mohammad Rifqi
Courses Plus Student 3,218 Points

thx, and also i had an error > $step = array()';'