str::substr($str, $start, $length = null)

An UTF-8 safe version of substr()

  • $str (string)
  • $start (int)
  • $length (int)
  • return (string)

Example

<?php
$string = 'Kirby CMS';
$substr = str::substr($string, 0, 5);

echo $substr;

Result:

Kirby