Explode string php

0

I have a strange problem at least, at least for me.

I have a string in php:

$str='10,20,30,40';
explode(',',$str);

When I make 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" ?

    
asked by anonymous 31.03.2017 / 16:59

1 answer

0

Or you can do the following:

<?php
 $json = str_replace('\n', '', $json);
?>

is an option when you have \ n between text

    
01.04.2017 / 15:01