PHP ile (küçük sonlu olarak) base64 çözmek için nasıl?

2 Cevap php

How can I decode a base64 encoded message in PHP? I know how to use PHP_base64_decode function, but I wanna know how to write little endian part, like the code below, it is base64 code with little endian: (how to write little endian part in php)

Original Base64 Content ( as posted by original poster ):

http://stackoverflow.com/revisions/viewmarkup/374860

2 Cevap

base64_decode() işlevini kullanın.

Base64 yazdırılabilir karakterler içine bayt akışı dönüştürür. Yanlış bir şey yoktur.

'Little-endian' describes one of two ways a number can be converted into a sequence of bytes: little-endian = least significant byte first. Big-endian = most significant byte first. UTF-8 is a string encoding into a stream of bytes, and there is concept of endianness to be applied. UTF16, however, encodes text into 16-bit words, and there are two ways to encode the words into bytes, and UTF16 comes in two flavors: UTF16LE (little endian) and UTF16BE (big endian). The same concept of endianness is also applied to UTF32, but this is not a common format.

If, by little-endian, you mean UTF16LE, then you have to decide to which format you want to re-encode the string (probably UTF-8).
You can use this function: mb_convert_encoding($input, 'UTF-8', 'UTF-16LE')[1][2]

Little-endian tarafından, sayıları Yani, eğer, o zaman numaraları içine bayt dönüştürme hangisi noktada endianness'ın belirtmeniz gerekir.

[1] http://cz.php.net/manual/en/function.mb-convert-encoding.php
[2] http://cz.php.net/manual/en/mbstring.supported-encodings.php