Name

substr_compare

Synopsis

int substr_compare(string first, string second, string
   offset[, int length[, bool case_insensitivity]])

Compares first, starting at the position offset, to second. If length is specified, a maximum of that many characters are compared. Finally, if case_insensitivity is specified and true, the comparison is case-insensitive. Returns a number less than 0 if the substring of first is less than second, 0 if they are equal, and a number greater than 0 if the substring of first is greater than second.

Get Programming PHP, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.