php string with double quotes echo backslash instead -


i have string:

while($this->stmt->fetch()){                 $string=$string.'","'.$idruolo;                 $i++;             }                    $str= ltrim($string,',"');        $str=stripslashes($str);               echo json_encode($str); 

i have tried can't delete backslash result, output:

"2\",\"1\",\"3"

this want:

"2","1","3"

try str_replace.

$str = str_replace("\\","",$str); 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -