0 points

Test if String Starts With Certain Characters in PHP


dashboard

Fri May 29 2020 10:07:44 GMT+0000 (UTC)

Posted by @Amna #javascript #php

function startsWith($string, $startString) {
  return strncmp($string, $startString, strlen($startString)) === 0;
}
content_copy Copy

https://css-tricks.com/snippets/php/test-if-string-starts-with-certain-characters-in-php/