<?php
class Summer
{
private $arr;
public function arr()
{
$arr = ['Apple', 'Orange', 'Gramm', 'Metr'];
foreach ($arr as $key) {
return $key . '<br>';
}
}
}
$name = new Summer();
echo $name->arr();
public function arr()
{
$arr = ['Apple', 'Orange', 'Gramm', 'Metr'];
return implode('<br>', $arr);
}