PagesNames::names method
If given name has a numbered suffix, return array with name (excluding suffix) and the numbered suffix
Returns array like [ 'name', 123 ] where name is name without the suffix, and 123 is the numbered suffix.
If the name did not have a numbered suffix, then the 123 will be 0 and name will be the given $name.
Usage
// basic usage
$array = $pages->names->nameAndNumber(string $name);
// usage with all arguments
$array = $pages->names->nameAndNumber(string $name, string $delimiter = '');Arguments
| Name | Type(s) | Description |
|---|---|---|
$name | string | |
$delimiter (optional) | string | Character(s) that separate name and numbered suffix |
Return value
array
$pages->names methods and properties
API reference based on ProcessWire core version 3.0.253