I need to locate 2 tags in a lump of text and keep whatever text is between them.
For example if the \"Begin\" tag was -----start-----
and the \"End\" t
Try this:
$start = '-----start-----';
$end = '-----end-----';
$string = 'rtyfbytgyuibg-----start-----isnv4b987b6vdc5y6ughnjmn9b8v76ctyubinn98b76r-----end-----gcgkhjkn';
$output = strstr( substr( $string, strpos( $string, $start) + strlen( $start)), $end, true);
echo $output;
This will print:
isnv4b987b6vdc5y6ughnjmn9b8v76ctyubinn98b76r