chr
laravel/framework
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
());
}
tests/Support/SupportStringableTest.php
public function
testStringWithoutWordsDoesntProduceError
()
{
$nbsp
=
chr
(
0xC2
).
chr
(
0xA0
);
$this
->
assertSame
(
' '
,
Str
::
words
(
' '
));
$this
->
assertEquals
(
$nbsp
,
Str
::
words
(
$nbsp
));
}
tests/Support/SupportStrTest.php