I’m trying to use json to send text and blob image information from MySQL to iPhone App.
However, someone told me that I should separate text and blob image info because blob is technically not binary – thus I have to use base64_encode(). Well…. I’m going to create two php files but want to check if it’s possible to do it in one php file. :/ I tried but n o luck yet… Is it even possible?
I’m trying to use json to send text and blob image information from MySQL
Share
You can invoke
json_encode, the function, as often as you want.But throwing the output together is not going to work.
If you intended to do
Then this will lead to an invalid JSON response.
Like
{"data":123} {"image":"PNG%...."}You need to combine the data and the image blob somehow if you want this to work in one response: