Question: For example, my string is: `DELIMxxxyyyzzzaaabbbcc,DELIMaaabbcccxxxyyyzzz,DELIMzzzyyyxxxaaabbbccc,DELIMyyyaaabbb,`

You can see this data is organised in delimited groups. I want to extract the second group (for example) where I'm given the position (in this case 24) and the next delimiter which I know to be "DELIM".

What combination of `substr` and `strpos` or others would I use to get this?

Answer: 
Use `strpos` to select the start and end position of your delimited group. Then you can use `substr` to get the delimeted group by selecting the string between those two positions.

```
$offset = 4;

$start = strpos($mystring, 'DELIM', $offset); //select start point

$end = strpos($mystring, 'DELIM', $start+5); //select end point by selecting next delimiter

$substr = substr($mystring, $start, $end-$start);

```
You can use strpos with offset 

```
$mystring = 'DELIMxxxyyyzzzaaabbbcc,DELIMaaabbcccxxxyyyzzz,DELIMzzzyyyxxxaaabbbccc,DELIMyyyaaabbb,'
$pos = strpos($mystring, 'DELIM', 24+1 + strlen('DELIM'));

$myPart = substr($mystring, 24, $pos);

```