I have an array in PHP that I am looping through to get content.
When echoed, the results of my array variable $myArray
looks like the below
Array(
[0] => ABC
[1] => DEF
[2] => GHI
[3] => JKL
)
Array(
[0] => MNO
[1] => 123A
[2] => 123B
[3] => 123C
)
Array(
[0] => orange
[1] => yellow
[2] => green
[3] => blue
)
But when i pass this to the html data element using
data-results = "$myArray"
I get a
Notice: Array to string conversion
error.
How can this be passed as one array to the html data element?