Skip to content
Advertisement

Passing Numbers in array format – Laravel [closed]

I am trying to convert string to an array format in my code below. I tried to use explode but it returns my results as

In my code i have

File.php

JavaScript

When i use explode results looks like

JavaScript

This is how i want my results to look like

JavaScript

PS: Beginner in laravel PHP

Advertisement

Answer

Explode it before doing the json_encode

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement