PHP rawurldecode () function


string rawurldecode ($str)
Parameters:This function accepts single parameters $str, which are required. It is used to store the encoded URL.Return Value:This function returns a URL decode string.The following programs illustrate the rawurldecode() function in PHP. Program 1: echo rawurldecode ( "A% 20computer % 20science% 20portal% 20for% 20geek " ); ?> Exit:
A computer science portal for geek
Program 2: $str = 'GeeksforGeeks A computer science portal for geek' ;  
// Encode this string $encode_str = rawurlencode ( $str ); echo "Encoded string:" . $encode_str . "< br >" ;  
// Decode the encoded string $decode_str = rawurldecode ( $encode_str ); echo "Decodec string:" . $decode_str ; ?>
Encoded string: GeeksforGeeks% 20A% 20computer% 20science% 20portal% 20for% 20geek 
Decodec string: GeeksforGeeks A computer science portal for geek
Related Articles:
  • PHP | Base64_encode() function
  • PHP | Base64_decode() function

Get Solution for free from DataCamp guru