I have the following code in PHP:
$keys = array('a', 'b', 'c');
$data = array();
$data[0] = array_fill_keys($keys,'');
After some follow-up code, when the array set is empty, it returns:
a,b,c
,,,
I’ve slimmed down to the problem is $data[0] = array_fill_keys($keys,'');
What can I do to have the result as:
a,b,c
Thanks.
it will output the letter a and a,b,c,
rtrim()function remove chars from right side of the strig, for left side useltrim()