PHP Tutorial: How to Remove (escape) Forward Slashes When Using json_encode()

You only need to use the JSON_UNESCAPED_SLASHES flag:

From →

Don’t escape /. Available since PHP 5.4.0.

Example Demo →

Example Output:


Was this blog post helpful for you?

Support my blog and donate!

My blog is open to the public and will always be freely available. With your donation, we can help others learn, together.

Donate in Bitcoin: