Function: common_prefix()

function common_prefix(string $s1, string $s2, int $max = 1000): string;

Defines the common prefix of two strings.

Parameters

Name Pass type Value type Default value Description
$s1 by value string

First string to be checked.

$s2 by value string

Second string to be checked.

$max by value int 1000

The maximal number of charactes to check.

Returns

string

Returns the common prefix of the passed strings.

Authors

Oleg Schildt

Package

Source code