$product->{"PICTURE"}
$product['PICTURE']
$b = new B();
class A {
protected $age = 5;
public function get() {
$this->age = 10;
}
}
class B extends A {
public function get() {
parent::get();
echo $this->age;
}
}
$obj = new B();
$obj->get(); // 10
(1.5625rem - 1rem) *
grecaptcha-badge
. <pre>
echo '<pre>';
print_r($array);
echo '</pre>';
function sum(...$numbers) {
$acc = 0;
foreach ($numbers as $n) {
$acc += $n;
}
return $acc;
}
echo sum(1, 2, 3, 4);
function rotateArray($arr, $shift) {
$shift %= count($arr);
array_unshift($arr, ...array_splice($arr, -$shift));
return $arr;
}
$arr = range(1, 7);
echo implode(', ', rotateArray($arr, 1)); // 7, 1, 2, 3, 4, 5, 6
echo implode(', ', rotateArray($arr, -3)); // 4, 5, 6, 7, 1, 2, 3
echo implode(', ', rotateArray($arr, 69)); // 2, 3, 4, 5, 6, 7, 1