I have data in my database as
COl1 | COL2
fruit | apple, grape, berry
vegetable | tom, pot, leaf
If I query for fruit, I want COL2 to read for the query and data is split and output echo json_encode($data)
should be in the form of:
[
{input: "fruit", target: "apple"},
{input: "fruit", target: "grape"},
{input: "fruit", target: "berry"} ]
Any suggestions?