0
I have a strange problem at least for me.
I have a string in php:
$str='10,20,30,40';
explode(',',$str);
When I do the string explode and pass the result to a view via $ajax I get the following result:
"\n n10203040"
Can someone explain to me why "\n n"?
Have you tried to put the result of the explosion inside the
json_encode
before sending?– JuniorNunes
It’s line breaking, use a
trim()
in string.– rray
@rray missed the answer :)
– Sergio
I’ve tried it doesn’t work.
– Helder Pereira