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.
Add a comment
|
1 Answer
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
4 Comments
Aurora
So can I write it like this $IBAN = urldecode($iban); ??
Justinas
@Aurora Yes if you have
$iban variable definedAurora
$iban is basically the string of 'FI64%201660%203000%201176%2025'
Aurora
Thanks :D I will accept your answer after the timelimit is over