Oihana PHP

append.php

Table of Contents

Functions

append()  : string
Append one or more suffix strings to the given source string, then normalize the result.

Functions

append()

Append one or more suffix strings to the given source string, then normalize the result.

append(string|null $source, string ...$suffix) : string

If the source string is null, returns an empty string. If multiple suffixes are provided, they are concatenated before appending. The resulting string is normalized using Unicode Normalization Form C (NFC).

Parameters
$source : string|null

The original string or null.

$suffix : string

One or more suffix strings to append.

Tags
throws
InvalidArgumentException

If the resulting string is invalid UTF-8 or cannot be normalized.

example
use function oihana\core\strings\append;

echo append( 'hello', ' ', 'world'); // Outputs: "hello world"
echo append( null, 'foo');           // Outputs: "foo"
author

Marc Alcaraz (ekameleon)

since
1.0.0
Return values
string

The normalized concatenation of source and suffix(es).


        
On this page

Search results