I have 1 key-value array in PHP. For Example:
<?php
$url = "https://mywebsite.com";
$resultArray = array(
"error" => "null",
"url" => $url,
);
echo json_encode($resultArray);
?>
**Output:** {"error":"null","url":"https:\/\/mywebsite.com"}
As you see above when I echo the json encode output. The browser itself add backslash "\" with each trailing slash "/". Means if i pass "https://mywebsite.com" in json key-value pair the result of i got is something like this "https://mywebsite.com" . But i don't want that backslash. I wants to echo a plain URL.. I used the urlencode method but that converts the slashes to encode format.. How can i resolve this issue.. I searched many topics on net but i didnt get the exact output which i'm looking at..
splitorexplodethe string and the work on that.