So I am trying to remove line feed within an array but not cariage returns. Having trouble using array walk, the ltrim function is not working.
I need to remove ONLY the line feed("\n") not the cariage return("\r") so using trim will not work. I tried setting the chr(10) and still not working. Any idea's
$array = array(
[0] => array(C1TEXT => 0001),
[1] => array(C1TEXT => 0002),
[2] => array(C1TEXT => \n),
[3] => array(C1TEXT => \r),
[4] => array(C1TEXT => 0003),
[5] => array(C1TEXT => 0004),
[6] => array(C1TEXT => 0005),
[7] => array(C1TEXT => \n),
[8] => array(C1TEXT => 0006),
)
$new_array = array_walk_recursive($array, 'ltrim', "\n");
echo json_encode($new_array);