base64_encode

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Encodes data with MIME base64
<?php base64_encode(string $string): string
<?php     public function testBinaryResourceConvertsToPHPValue(): void

    {

        $databaseValue = fopen('data://text/plain;base64,' . base64_encode('binary string'), 'r');

        $phpValue      = $this->type->convertToPHPValue($databaseValue, $this->platform);



        self::assertSame($databaseValue, $phpValue);
<?php     public function testBinaryResourceConvertsToPHPValue(): void

    {

        $databaseValue = fopen('data://text/plain;base64,' . base64_encode($this->getBinaryString()), 'r');

        $phpValue      = $this->type->convertToPHPValue($databaseValue, $this->platform);



        self::assertSame($databaseValue, $phpValue);
<?php     public function testJsonResourceConvertsToPHPValue(): void

    {

        $value         = ['foo' => 'bar', 'bar' => 'foo'];

        $databaseValue = fopen('data://text/plain;base64,' . base64_encode(json_encode($value)), 'r');

        $phpValue      = $this->type->convertToPHPValue($databaseValue, $this->platform);



        self::assertSame($value, $phpValue);