I have some text like $text="--e89a8f234aade3345704b8477b83 Content-Type: text/plain; charset=ISO-8859-1 this is a text. this is a text. --e89a8f234aade3345704b8477b83 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable this is a text.";
I want the output as $output="this is a text. this is a text.";
One more eg:- $text="--14dae9340ba954ae0704b84acde9 Content-Type: text/plain; charset=ISO-8859-1 First Name: aaa Last Name: aaa --14dae9340ba954ae0704b84acde9 Content-Type: text/html; charset=ISO-8859-1 First Name: James Last Name: Cummings --14dae9340b";
Output should be $output="First Name: aaa Last Name: aaa";
I am not getting how to do this.
In case you are sure that charset is ISO-8859-1 and string does not contain — :
If you’re still sure about the charset, but not the –:
And if you’re not even sure about the charset: