我正在使用这种技术将图像作为 blob 存储在 mysql 中
INSERT INTO aw_offers_v2
(
id,name,description,payout_type,
payout,expiration_date,creation_date,preview_url,
tracking_url,categories,countries,countries_short,
api_key,network_id, icon)
VALUES
('$id','$name','$description','$payout_type',
'$payout','$expiration_time','$creation_time','$preview_url',
'$tracking_url','$categories','$countries','$countries_short',
'$api','$api_url','".mysql_real_escape_string(file_get_contents($cover_image_src))."')
现在的问题是,我如何获取 blob 元素的大小并将其存储在另一个字段中
假设 blob 大小为 5.34kb,我需要获取它并将其存储到另一个名为 blob_size 的字段中
最佳答案
简单的方法 - 您可以使用 strlen( file_get_contents($cover_image_src) )
关于php - 如何获取从 file_get_contents() 派生的内容的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27100958/