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 with (var_dump(explode(',',($CheckBoxAnswer)));) it then its return following :
array(1) { [0]=> string(26) "Service,House Worker" }
but i want something similar:
array(1)
(
[0] => string(7) "Service"
[1] => string(13) "House Worker"
)
$CheckBoxAnswer is contain data i pulled from mysql.
i tried with var_dump(explode(',',($CheckBoxAnswer)));
but its not working
Try this:
var_dump(explode(',',($CheckBoxAnswer[0])));
You are tring to explode an array into an another array. You need to specify the string instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With