str::endsWith($string, $needle)

Checks if a string ends with the passed needle

  • $string (string)
  • $needle (string)
  • return (boolean)

Example

<?php
$string = 'Kirby is a file-based CMS';
if(str::endsWith($string, 'CMS')) {
  echo 'The string ends with "CMS".';
}