I have 2D arrays like this.
Array ( [0] => Array ( [0] => 1 [1] => 1 [2] => 0 [3] => 1) [1] => Array ( [0] => 1 [1] => 0 [2] => 0 [3] => 0) [2] => Array ( [0] => 1 [1] => 0 [2] => 0 [3] => 0
What I want is to print all this elements as a one string. That means, to print "110110001000"
I tried out something like this
for ($x = 0; $x < $this->smallersize; $x++) {
for ($y = 0; $y < $this->smallersize; $y++) {
$myarray[$x][$y] = ($dct[$x][$y] >= $avg?"1":"0");
}
}
return join('',$myarray);
What I want is to print "110110001000"
My problem is when I tried out the above function it gives an
Error : "Array to string conversion" in line "return join('',$myarray);"
How to solve this?