filesize from a String

前端 未结 5 577
自闭症患者
自闭症患者 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:49

    strlen()
    

    before putting it into mysql, or in SQL:

    LENGTH()
    

    Notice that lenght can be various depending on character set. If you want to have real length in bytes use strlen(), if you want to have character count use mb_strlen() (if you have utf-8 encoding for example)

提交回复
热议问题