Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php 7 starts with

You can use this in PHP versions less than 8.

<?php
function str_starts_with ( $haystack, $needle ) {
  return strpos( $haystack , $needle ) === 0;
}
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #php #starts
ADD COMMENT
Topic
Name
1+4 =