filesize from a String

前端 未结 5 575
自闭症患者
自闭症患者 2021-02-07 21:13

how can i get the \"filesize\" from a string in php?

I put the string in a mysql database as a blob and i need to store the size of the blob. My solution was to create

5条回答
  •  你的背包
    2021-02-07 21:35

    SELECT length(field) FROM table

    From the MySQL docs:

    LENGTH(str)

    Returns the length of the string str, measured in bytes. A multi-byte character counts as multiple bytes. This means that for a string containing five two-byte characters, LENGTH() returns 10, whereas CHAR_LENGTH() returns 5.

提交回复
热议问题