Lets assume in my Gmail Inbox I have just one message subject from a friend titled "How are you mutago"
In the body of the message I have " Hello Mutago how are you doing. I wish you are fine".
Now I respond to my friends message as per "Well My friend am doing fine."
As you can see now under the Message subject "How are You mutago"
We have 2 messages or responses ie one from me and other from my friend who sent the mail.
my question is how do i get the two seperate messages/rows and insert into database.
The code below only explode and insert data line by line. In that case I have more than 10 rows inserted into my database
instead of just 2 rows corresponding to the two messages on my mail box.
I guess the problem is from explode function, please how do i fix that.
$str = $email_body_messages;
$piece = explode(PHP_EOL, $str);
foreach($piece as $substr){
// Insert into database via PDO
}
Thanks

New Topic/Question
Reply


MultiQuote



|