php - How to encode blob to base64 string on yii framework? -
i want encode blob image db base64 string, want encode string json. i've tried this:
$img = image::model()->findbysql('select img tbl_img id=1'); $value = chunk_split(base64_encode($img)); echo cjson::encode($value);
the img field above blob. , i've got nothing. can help?
use
echo json_encode($value);
instead of
echo cjson::encode($value);
Comments
Post a Comment