Skip to content
Advertisement

PHP – format path urls

In my PHP project, I have an url path string returned like:

JavaScript

What I would like to accomplish is for this two paths to be without and % ..

How can I format them?

I know this question is already answer but I can not find right PHP fucntion for it.

Code:

JavaScript

and the problem persists.

Advertisement

Answer

Working Solution:

The PHP Function stripcslashes() does what you need: Removes the escaping character where it’s not needed.

The %.. characters are part of URL Encoding, so don’t remove them.

Here is a working solution how to remove the from your object:

JavaScript

Old answer:

This is a JSON String and the backslashes are part of JSON formatting.

Remove it by decoding it:

JavaScript

$rawData is now:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement