MadelineProtoDocs/old_docs/API_docs_v27/types/bytes.md

22 lines
575 B
Markdown
Raw Normal View History

2018-04-01 13:19:25 +02:00
---
title: bytes
description: A string of variable length
2018-04-04 19:52:48 +02:00
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
2018-04-01 13:19:25 +02:00
---
## Type: bytes
[Back to constructor index](index.md)
2020-02-26 18:12:26 +01:00
```php
$bytes = "simple string of bytes";
```
Internally, an object of type `\danog\MadelineProto\TL\Types\Bytes`.
2018-04-19 19:56:40 +02:00
When casted to string, turns into a string of bytes of variable length, with length smaller than or equal to 16777215.
When JSON-serialized, turns into an array of the following format:
```
[
'_' => 'bytes',
'bytes' => base64_encode($contents)
];
```