Web development articles
If you are looking for an alternative to base64_decode() in PHP then this page might help you. To jump straight to the code click here.
You might have come across an issue where your hosting company has disabled the function and as a result you are getting an error about base64_decode() being disabled.
The reason the hosting company has disabled base64_decode() in PHP is that infected websites will have code injected that uses the function. While disabling base64_decode() in PHP will effectively disable the infection, it will unfortunately also break any other code that uses the function legitimately.
So if you cannot convince the hosting company to re-enable the function and you do not wish to move your website to a different host, then you can always use the code below as a drop in replacement to base64_decode() in PHP.
Please note the disclaimer! We do not take any responsibility that the function below works as intended. It worked for us with very limited testing. Also performance is likely to be poor but in our situation performance was never an issue. This is a straight port of the implementation found here.
As always, your feedback and comments are much appreciated!
To see the code click here.