<?php
/*
* Based on Anthony Ferrara's answer on stackoverflow
* https://stackoverflow.com/questions/3511106/filesize-from-a-string
*/
public function getFileSizeOfString(string $string) {
if (function_exists('mb_strlen')) {
return mb_strlen($string, '8bit');
}
return strlen($string);
}