I want to clean my old_array and split it up to array of objects. So the new_array contains string and integer.
This is my old_array named $test_temp_variable which is only in string.
discount_org: [
[
"{"day":"00:00"",
""time":"08:00"",
""discount":"10:00""
],
[
""day":"00:00"",
""time":"14:00"",
""discount":"10:00""
]
This is my desired output
discount_org: [
{
day: 0,
time: 8,
discount: 10
},
{
day: 0,
time: 14,
discount: 10
}
but is this even possible in PHP? I have tried in several object-oriented features, but always end up not working. If yes, can you give a finger point?
var dump of my old array
array(7) {
[0]=>
array(3) {
[0]=>
string(13) "{"day":"8:00""
[1]=>
string(14) ""time":"12:00""
[2]=>
string(15) ""discount":"10""
}
[1]=>
array(3) {
[0]=>
string(12) ""day":"8:00""
[1]=>
string(14) ""time":"12:00""
[2]=>
string(15) ""discount":"10""
}