I have 2 variables in my php file and I want to combine it.
// Option 1
$x= array();
$x[] = '<h1>Hello</h1>';
$x[] = '<h1>World!</h1>';
// Option 2
$y= array();
$y[] = '<h1>This is</h1>';
$y[] = '<h1>Me!</h1>';
//Combined Options
$data = array();
$data[] = $x;
$data[] = $y;
If I return the $data
return $data; // this returns array to string error
and if I return the $x
return $x; // this is working
and if I return the $y
return $y; // this is working
However I'm getting array to string conversion error. My goal is,
to combine $x and $y