Array of strings to array of words
I have data in my mysql database "Service, House Worker" (without "") when I access my data from the database I found (Service, House Worker) as it is when I try to convert from using var_dump(explode(',',($CheckBoxAnswer)));
), then it is returned as follows:
array(1) { [0]=> string(26) "Service,House Worker" }
but I want something like this:
array(1)
(
[0] => string(7) "Service"
[1] => string(13) "House Worker"
)
$CheckBoxAnswer
contains the data that I pulled from mysql. i tried using var_dump(explode(',',($CheckBoxAnswer)));
but its not working
+3
source to share
2 answers