Substrings PHP

If you know where in a larger string the interesting data lies, you can copy it out with

the substr( ) function:

$piece = substr(string, start [, length ]);

The start argument is the position in string at which to begin copying, with 0
meaning the start of the string. The length argument is the number of characters to
copy (the default is to copy until the end of the string).
For example:

$name = "Fred Flintstone";
$fluff = substr($name, 6, 4); // $fluff is "lint"
$sound = substr($name, 11); // $sound is "tone"
To learn how many times a smaller string occurs in a larger one, use substr_count( ):
$number = substr_count(big_string, small_string);