no messing up at all, au contraire, this is just what I needed!
thanks a lot! this saved me hours!
peace,
bonzo
Edit:
ok, here´s the final approach, which definitely solved the problem (if anyone is interested):
Code:
// first I set all the search indicators into one array, as "data1" might be //"DAta1" or "data 1" as well...
$searchterms = array("data1", "DAta1", "data 1", "data2"....);
//then I check'em all
foreach ($searchterms as $searchterm)
{
$nl = chr(13) . chr(10);
$indicator = utf8_decode($searchterm);
//Find out where data begins
$dataStart = strpos($body, $indicator) + strlen($indicator);
//Find out where data ends
$dataEnd = strpos($body, $nl, $dataStart) - (strpos($body, $indicator) + strlen($indicator));
$data = substr($body,$dataStart,$dataEnd);
//Capture the data
$data_full[$searchterm] = utf8_encode($data);
}
as i cannot know which of the $searchterms is showing up at all and especially which one is following, the $dataEnd-strpos is checking from the next linebreak (defined as $nl) following $dataStart.
utf8_decode and utf8_encode are used because otherwise special characters used in the mail body will cause SERIOUS trouble!
peace,
bonzo