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

1111. appearing after print sequence - php -

excel - I can't get the attachement of the email PHP -

node.js - Express and Redis - If session exists for this user, don't allow access -