title: php calculate file size after reading the content
body: <p>Using php i have contents of a file through file_get_contents() function. I want to calculate the size of the file using the contents. Is there a precise way to do it ?</p>
  
  <p>I tried strlen(contents) , suggested in one of the answers , but there is quite difference in size returned and actual file size on computer.</p>
  
  <p>Note : using ubuntu 12.04  </p>
  
  <p><strong>EDIT</strong> : sorry for the waste of time guys, it seems the contents were base64_encode() which led to mismatch in sizes. I appreciate your time and effort. Sorry again.</p>