Home > Tips and Tricks, Web Development > PHP simple 2 way plain text encryption

PHP simple 2 way plain text encryption

See https://naveensnayak.wordpress.com/2013/03/12/simple-php-encrypt-and-decrypt/

  1. Dia Febus
    November 13, 2013 at 3:35 PM

    In my case I had problems with rtrim function:

    $output = rtrim($output, “”);

    It didn’t trim the string correcty because “” is not trimming some hidden characters.

    SOLUTION

    Remove second parameter:

    $output = rtrim($output);

    Without the second parameter, rtrim() will strip these characters:

    ” ” (ASCII 32 (0x20)), an ordinary space.
    “\t” (ASCII 9 (0x09)), a tab.
    “\n” (ASCII 10 (0x0A)), a new line (line feed).
    “\r” (ASCII 13 (0x0D)), a carriage return.
    “” (ASCII 0 (0x00)), the NULL-byte.
    “\x0B” (ASCII 11 (0x0B)), a vertical tab.

    http://www.php.net/manual/en/function.rtrim.php

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: