Check whether a string starts with a prefix in PHP

// strncmp compares at most n bytes and allocates nothing
if (strncmp($sku, 'REF-', 4) === 0) {
    // ...
}

// the same test without writing the length down twice
if (strncmp($sku, $prefix, strlen($prefix)) === 0) {
    // ...
}