How to convert base64 string to binary array using php

I have a base 64 encoded encoding that looks something like this.

cuVrcYvlqYze3OZ8Y5tSqQY205mcquu0GsHkgXe4bPg=

I tried base64_decode and output.

råkq‹å©ŒÞÜæ|c›R©6Ó™œªë´Áäw¸lø

I think I can do something wrong. I appreciate any help for converting base64 to a binary array.

thank

+3
source share
2 answers

like this

$a = base64_decode("cuVrcYvlqYze3OZ8Y5tSqQY205mcquu0GsHkgXe4bPg=");
$b = array();
foreach(str_split($a) as $c)
    $b[] = sprintf("%08b", ord($c));
print_r($b);
+3
source

base64_decode ( ), - , (?). "0011010110011001" , () . 1 0 , . 1 0, / . .

, . "0100101010".

0

Source: https://habr.com/ru/post/1765495/


All Articles