How to encode few characters in PHP?

How to encode few characters in PHP?

I mean if I want 12345 to be encoded in my own way(using my own personal decoding key), so that no one else can read this.

How to do this?
I tried base64_encode, and base64_decode, but they can be easily decoded by anyone.

Kindly someone help…

Take a look at the mcrypt library and [URL=“http://www.php.net/manual/en/mcrypt.examples.php”]examples. :slight_smile:

Thanks sir.

But sir, these all can do the encoding in PHP itself, and not when we view their HTML source.

I saw 1 website which is encoding the data in total in the HTML source as well.

Quoting your question:

How to encode few characters in PHP?

Quoting your response:

But sir, these all can do the encoding in PHP itself, and not when we view their HTML source.

I saw 1 website which is encoding the data in total in the HTML source as well.

First, what you’re asking for is not ENCODING, it’s ENCRYPTION.

Second, you can’t encrypt HTML source. You can obfuscate it, making it harder for someone to view it in human readable format, but not impossible to obtain the source if they want to.
If you want to deny someone of viewing the plain text output of your HTML or JavaScript - forget it. It won’t work, if someone wants to see it - they will.

@Blue
Yes, About my previous question, I got it working.
But, suddenly after getting answer to my first question, second question also came to my mind.