CKTIS / PHP
base64_encode()
Codifica byte arbitrari in Base64 per un campo testuale.
Versione: PHP 8.4; repository runtime, production runtime not attested
Sintassi
base64_encode(string $string): stringCodifica byte arbitrari in Base64 per un campo testuale. Tre byte producono quattro caratteri e l’ultimo gruppo può avere segni di uguale di riempimento. L’alfabeto contiene più e barra, quindi codifica opportunamente il componente URL.
Firma
base64_encode(string $string): string
Output dell’esempio
["","YQ==","+/8="]
Esempi
<?php
echo json_encode([base64_encode(""),base64_encode("a"),base64_encode("\xFB\xFF")],JSON_UNESCAPED_SLASHES);
Risultato
["","YQ==","+/8="]