String functions

$testString = 'this is a random string to illustrate PHP string functions'

Length of $testString = 58

Position (first occurrence!) of 'is' in $testString = 2

Execute the statement $testString = ucfirst($testString);

$testString = 'This is a random string to illustrate PHP string functions'

Execute the statement $subString = substr($testString, strpos($testString, 'P'), 3);

$subString = 'PHP'

Execute the statement $testString = str_replace('PHP', 'some', $testString);

$testString = 'This is a random string to illustrate some string functions'

Execute the statement $words = explode(' ', $testString);

$words =

Array ( [0] => This [1] => is [2] => a [3] => random [4] => string [5] => to [6] => illustrate [7] => some [8] => string [9] => functions )

Numbers with 2 decimal digits and , as decimal point: