Jump to content

I have been working on a block of code for some time now, and the stripslashes function suddenly started failing. Im not sure why, nothing has changed and it has been working fine for weeks, but it decided to hate me and i have to fix it.

 

I am pulling from an API. Viewing in the browser you see:

{"status": "ok","controller": "auth","method": "generate_auth_cookie","nonce": "1a46b3559d"}

When pulling from withen the script, i get:

"{\"status\":\"ok\",\"controller\":\"auth\",\"method\":\"generate_auth_cookie\",\"nonce\":\"8126142cd2\"}"

Simple enough, right? Just use the stripslashes() function, and away you go. But when i do the stripslashes function i get the exact same thing:

"{\"status\":\"ok\",\"controller\":\"auth\",\"method\":\"generate_auth_cookie\",\"nonce\":\"8126142cd2\"}"

Does anyone know whats up? Or how i could fix this? I need to be able to do the json_decode() function and cannot with the escaped quotes in the way.

 

 

Thanks a ton!

~Judah

Link to comment
https://linustechtips.com/topic/374297-php-stripslashes-not-working/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×