1. Home
  2. FAQ
  3. PHP FAQ
  4. PHP – Extract Substring from String

PHP – Extract Substring from String

How to Extract A Substring from A Main String

The PHP substr() function is used to extract a Substring from a main string. Using this method you can grep a part of string by providing start and end point of number.

First see the below example: