Home / PHP Tips Generated By ChatGPT / Extracting Substrings in PHP Use substr() to extract a portion of a string. Source Code echo substr("Hello, World!", 7, 5); // Outputs: World