PHP Base64_decode

I am using the following code to encode a URL for basic hiding of the URL

/lbs_map.php?msisdn=27827910118

This is what I do not want my clients to see. I have coded it the following way

<a href="lbs_map.php?msisdn=<?php echo base64_encode ("27".substr($rows['member_msisdn'],  
1)); ?>

This is my output now:

/lbs_map.php?msisdn=Mjc4Mjc5MTAxMTk=

I am using this to try and decode the string:

<?php
$str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==';
echo base64_decode($str);
?>

But it is not working at all to decode it and give me the required info i want. I need help on the decoding of the string

The encode string must work with the code string as the code string varies and is never the same

If you're passing base64 encoded data via the url, you need to urlencode() it first as = is a reserved character in urls.

  1. You need to urlencode() the msisdn parameter.

  2. Also keep in mind that base64 is not the way to go if you want to hide something from your users as it's not an encryption function and can be easily decoded.