Gaufrette\Util\Size::fromContent PHP Метод

fromContent() публичный статический Метод

Returns the size in bytes from the given content.
public static fromContent ( string $content ) : integer
$content string
Результат integer
    public static function fromContent($content)
    {
        // Make sure to get the real length in byte and not
        // accidentally mistake some bytes as a UTF BOM.
        return mb_strlen($content, '8bit');
    }

Usage Example

Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function write($key, $content, array $metadata = null)
 {
     $result = apc_store($this->computePath($key), $content, $this->ttl);
     if (!$result) {
         return false;
     }
     return Util\Size::fromContent($content);
 }
All Usage Examples Of Gaufrette\Util\Size::fromContent