Home » Php » php – array slice taking part of value instead of values

php – array slice taking part of value instead of values

Posted by: admin February 25, 2020 Leave a comment

Questions:

we are trying to get 2 widgets from our array into 1 slide but the array_slice is taking 2 letters from the link not 2 links from the array

public function get_right_widget($id){
$statement=$this->database->connection->prepare("SELECT * FROM page_widget 
LEFT JOIN widget ON page_widget.widget_id = widget.widget_id WHERE 
page_id=:id");
$statement->bindParam(':id', $id);

$statement->execute();

return $statement->fetchAll(\PDO::FETCH_ASSOC);
foreach ($widget->get_right_widget($screen_id) as $widgets) {

echo implode(array_slice($widgets,0,2));
How to&Answers: