I have some PHP code the intercepts phone text messages.
Formats are different depending on carrier as phone text is transferred to email format. When it's an email then PHP gets involved.
AT&T adds a nice little tag line to every text to email message:
"This mobile text message is brought to you by AT&T" which is wrapped in some HTML.
I'm having trouble removing the that line.
I strip HTML
$org_text = strip_tags($org_text);
echo nl2br(". \n after html strip tags = $org_text ");
attempt to chop the message
$bad = 'This mobile text message is brought to you by AT&T';
$good = '';
$org_text = str_replace($bad, $good, $org_text);
echo nl2br(". \n after ATT words str replace 2 = $org_text ");
It doesn't find it. it can find parts of it. I can cut all but the ampersand but attempt to remove the ampersand fail.
Some other attempts:
$special = "&"; //here you can add as many char.
$org_text = str_replace($special,'',$org_text);
echo nl2br(". \n after ATT str replace for ampersand= $org_text ");
$org_text = preg_replace("/^[\&]$/i", "", $org_text);
echo nl2br(". \n after ATT preg replace for ampersand= $org_text ");
and yet it survives..
Advice welcome.