htmlspecialchars() expects parameter 1 to be string, array given

Posted 6 days ago by chrisgrim

Hi I am getting the error htmlspecialchars() expects parameter 1 to be string, array given. I think its because I have too many levels in my object? If I do a return $stats I get

[
{
"2019-06-27": 0,
"2019-06-28": 0,
"2019-06-29": 0,
"2019-06-30": 0,
"2019-07-01": 0,
"2019-07-02": 1,
"2019-07-03": 0,
"2019-07-04": 0,
"2019-07-05": 0,
"2019-07-06": 0,
"2019-07-07": 0,
"2019-07-08": 0,
"2019-07-09": 0,
"2019-07-10": 0,
"2019-07-11": 0
},
{
"2019-06-27": 0,
"2019-06-28": 0,
"2019-06-29": 0,
"2019-06-30": 0,
"2019-07-01": 1,
"2019-07-02": 0,
"2019-07-03": 0,
"2019-07-04": 0,
"2019-07-05": 0,
"2019-07-06": 0,
"2019-07-07": 0,
"2019-07-08": 0,
"2019-07-09": 0,
"2019-07-10": 0,
"2019-07-11": 0
},
{
"2019-06-27": 0,
"2019-06-28": 0,
"2019-06-29": 0,
"2019-06-30": 0,
"2019-07-01": 2,
"2019-07-02": 0,
"2019-07-03": 0,
"2019-07-04": 0,
"2019-07-05": 0,
"2019-07-06": 0,
"2019-07-07": 0,
"2019-07-08": 0,
"2019-07-09": 0,
"2019-07-10": 0,
"2019-07-11": 0
}
]
I am just trying to send this through to my vue chart with <chart-component :stats="{{$stats}}"></chart-component>

Thanks

Please sign in or create an account to participate in this conversation.