I have code like this
$word = 'foo';
$char_buff = str_split($word);
foreach ($char_buff as $chars){
echo var_dump($chars);
}
The output was
string(1) "f"
string(1) "o"
string(1) "o"
For some reasons, I want to make the output become only 1 string like this:
string(3) "foo"
I tried with this
$char.=$chars;
echo var_dump($char);
But it shows error Undefined variable: char
.