That's not encryption, though. For that, you need the mcrypt library
and to recompile PHP with mcrypt support (it's not the default.)
Then, from the available functions, use mcrypt_cfb(). This one
<b>requires</b> you to add an "initialization vector" which is
needed to avoid know-plaintext attacks--of course you have
to use a different "iv" each time, or you defeat the purpose of it.