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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

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