1. Before modification
problem code
Encoding directly through JSON will cause problems
code
$url = 'SO/'.$fileName;
echo json_encode($url);
Effect
2. After solving
Code
Use json_encode
the second argument of the function to disable escaping of slashes JSON_UNESCAPED_SLASHES
$url = 'SO/'.$fileName;
echo json_encode($url, JSON_UNESCAPED_SLASHES);