chr

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Generate a single-byte string from a number
chr(int $codepoint): string
    public function testWithoutWordsDoesntProduceError()

    {

        
$nbsp chr(0xC2).chr(0xA0);

        
$this->assertSame(' ', (string) $this->stringable(' ')->words());

        
$this->assertEquals($nbsp, (string) $this->stringable($nbsp)->words());

    }
    public function testStringWithoutWordsDoesntProduceError()

    {

        
$nbsp chr(0xC2).chr(0xA0);

        
$this->assertSame(' 'Str::words(' '));

        
$this->assertEquals($nbspStr::words($nbsp));

    }
        $string '';



        for (
$i 0$i 256$i++) {

            
$string .= chr($i);

        }



        return 
$string;
        $mask '';



        if (
$ones floor($prefix 8)) {

            
$mask str_repeat(chr(255), (int) $ones);

        }



        if (
$remainder $prefix 8) {
        }



        if (
$remainder $prefix 8) {

            
$mask .= chr(0xff ^ (0xff >> $remainder));

        }



        
$mask str_pad($mask$sizechr(0));
            $mask .= chr(0xff ^ (0xff >> $remainder));

        }



        
$mask str_pad($mask$sizechr(0));



        return 
$this->ipMapTo6($mask$size);

    }
        $net '';



        for (
$i 1$i 17; ++$i) {

            
$net .= chr($ip[$i] & $mask[$i]);

        }



        return array(
$net$netmask);
    private function ipMapTo6($binary$size)

    {

        if (
$size === 4) {

            
$prefix str_repeat(chr(0), 10) . str_repeat(chr(255), 2);

            
$binary $prefix $binary;

        }
            $int += 256;

        }



        return 
\chr($int);

    }

}
        if (!extension_loaded('mbstring')) {

            
$this->markTestSkipped('Test requires the mbstring extension');

        }

        
$backslash chr(92);

        
$data '"' $backslash $backslash $backslash 'u0119"';

        
$expected '"' $backslash $backslash 'ę"';