i m grabbing image paths from MySQL via php and then json_encode and with response data i m using below code to display image but not working
My PHP Code
$imgurl=array();
if(mysql_num_rows($result) > 0){
//Fetch rows
while($row = mysql_fetch_array($result)){
$imgurl = $row['imgurl'];
}
}
echo json_encode($imgurl);
else
{
echo "No results matching family \"$family\"";
}
The Code at my Jquery side
success: function( data ){
$('#pgwrapid').html(data);
}
the data is giving below output which are actually image paths
["images\/zara\/shoes\/thumbnail","images\/hermes\/shoes\/thumbnail","images\/hermes\/shoes\/thumbnail"]
now how to remove the backslashes and insert it in img src=””
Try Below :
But please check first if you are getting value in
valor not.