The problem is you keep overwriting the array:
$znaczki = array_merge(
array_fill(0, $iloscZnaczkow, 'c'),
array_fill(0, $iloscZnaczkow, 'd'),
array_fill(0, $iloscZnaczkow, 'h'),
array_fill(0, $iloscZnaczkow, 's')
);
is what you want. You don't really need the index math anymore, as array_merge will maintain the indices for you.