php - How to trim a Base-64 encoded string? -


I'm not too much a PHP expert; I am encoding a URL with base64_encode I'm quite weird I get very long encoded strings with letters as I want. Is there no way to trim the long line of such characters, say it 10 or 15 characters, can I explain it again later?

I know that is trim () but what I really do not want is I want to have a long encoded string that I want to reduce and then decode it again Want to do

Any thoughts?

  • If you do an encoded physically small If you want, it is not possible to "shorten any string".

    String (with only the end result is only a part of that string), apply not to substr () on the encoded version: decoding it first
  • Another option is minimize it is string it may be Reduce to some extent: Your benefits may vary depending on it, however: Compression rate will depend on which type of work you have The data with little input string, the result may be even larger than the original.

  • If you want to reuse a variable in a multi-page process , and do not transport it through any link or form Wish, consider creating a short random key and archive data in user session:

      $ _ session [$ random] = "lllloooooooooooong data here";  

    You can pass on a random key, and always access "long" data using the $ _ session [$ randomKey] . You must be the beginning for this.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -