str::startsWith($string, $needle)

Checks if a string starts with the passed needle

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

Example

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

Is something missing or incorrect? Edit this page on Github…