php encode and decode string with key

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

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

One thought on “php encode and decode string with key”

Leave a Reply

Your email address will not be published.