php encode and decode string with key

Many times php developers want to encode there php or important HTML,CSS or Javascript code. In this article I will show you the very simple encoding with using base64_encode method.

php encode and decode string with key

 

php encode and decode string with key

php encode and decode string with key

Here is working example.

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
$str = 'This is an encoded string';
echo base64_encode($str);

echo base64_decode("VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==");
?></pre>
<pre>

you can create your own antilogarithm for encoding. For more information you can check the following URL

http://php.net/manual/en/function.base64-encode.php

Add a Comment

Your email address will not be published. Required fields are marked *