Error when saving json to database mysql?

public function store(Request $request)
{
$image = ['http://localhost.loca/image/product/01-1627140249.jpg', 'http://localhost.loca/image/product/03-169983334.jpg'];
$product = new Product();
$product->image = json_encode($image);
$product->save();
}

And the results are stored in the database

["http:\/\/localhost.loca\/image\/product\/01-1627140249.jpg","http:\/\/localhost.loca\/image\/product\/03-169983334.jpg"]

There are \ being generated. is there any fix. Thanks.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3BBiWMq
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

How to Create Treeview with Bootstrap and jQuery

5 Free Black and White Social Media Icons Sets with CSS and HTML

How to Change Apache and MySQL Port Number in XAMPP Localhost