Blog Archives

String StartsWith and EndsWith in PHP

The following are a simple implementation checking whether a string starts or ends with another string in PHP. Note that we need triple equals sign (===) since strpos() may return FALSE, while FALSE == 0 is actually TRUE. The above

Tagged with: , , , , ,
Posted in PHP