0

Hi I am getting a string like this FI64%201660%203000%201176%2025 and I am trying to remove those % before putting it into the database I tried, both $str=preg_replace('/\s+/', '', $str); $string = str_replace(" ", "", $string); but did not work, So need help to remove those % from the string. I guess they are basically blank spaces from the input field.

1 Answer 1

1

Your string is url encoded (You need to replace %20 instead of only %, and yes, it's blank space). User urldecode for that:

echo urldecode('FI64%201660%203000%201176%2025');
//FI64 1660 3000 1176 25
Sign up to request clarification or add additional context in comments.

4 Comments

So can I write it like this $IBAN = urldecode($iban); ??
@Aurora Yes if you have $iban variable defined
$iban is basically the string of 'FI64%201660%203000%201176%2025'
Thanks :D I will accept your answer after the timelimit is over

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.