Tag Archives: php string

PHP – substr examples

PHP - substr examples

In this article lets explore substr examples in PHP. We can use substr in many ways in PHP. Let’s check through examples what we can do using this function. The basic syntax is as below : 1. Get substring from the middle of a string : Check below code snippet to get substring from a …

How to check if string starts with in PHP

How to check if string starts with in PHP

In this article lets understand how to check if string starts with in PHP. PHP provides many ways to find out if a string starts with any other specific string, let’s explore them. Among various versions of PHP the latest adds new functions which provides simple way to do so. PHP version 8 or greater …