Convert byte array to base64 php

Asked 5 years, 10 months ago

Viewed 8k times

I use Mssql and images on table like "0xFFD8FFE000104A46494...." . I think it is byte array.

And I wanna change it to image with PHP.

I try this;




But image doesn't show.

Code demo: (http://sandbox.onlinephpfunctions.com/code/61b8f073a70100338681e8ab37b0a75c930eca6e)

asked Nov 6, 2016 at 18:54

Convert byte array to base64 php

İsmetİsmet

852 silver badges12 bronze badges

2

You need to convert the hexadecimal string from SQL Server to base64. Try this, it should work :




answered Nov 7, 2016 at 2:25

MaxiWheatMaxiWheat

6,0266 gold badges47 silver badges74 bronze badges

3

You need to call base64_decode().

answered Nov 6, 2016 at 19:08

1