I am having a hard time figuring out where to go next.
I have set up a pipe to program on my cpanel that takes emails and sends em to a php script I have.
The script takes the email, extracts the body, and assigns the entire body to a variable called $body. What I need to do next, is take the information in the body, and make them more php variables that I can sent to an API.
The email will ALWAYS be in the same format.
This is what I get when I ask the script to send me an email of the $body variable.
--14dae934062f9d9cee04d111829f
Content-Type: text/plain; charset=ISO-8859-1
*field_1* = Illinois
*field_2* = miguel
*field_3* = martinez
*field_4* = miguel41303427@sbcglobal.net
*field_5* = 2305250033
*field_6* = streamwood
*field_7* = il
*field_8* = 2001
*field_9* = BMW
*field_10* = 325i
*field_11* = 129000
--14dae934062f9d9cee04d111829f
Content-Type: text/html; charset=ISO-8859-1
<p class="MsoNormal"><b>field_1</b> = Illinois<br>
<b>field_2</b> = miguel<br>
<b>field_3</b> = martinez<br>
<b>field_4</b> = <a href="mailto:miguel41303427@sbcglobal.net">miguel41307@sbcglobal.net</a><br>
<b>field_5</b> = 2305250033<br>
<b>field_6</b> = streamwood<br>
<b>field_7</b> = il<br>
<b>field_8</b> = 2001<br>
<b>field_9</b> = BMW<br>
<b>field_10</b> = 325i<br>
<b>field_11</b> = 129000<br></p>
--14dae934062f9d9cee04d111829f--
Is there a way to take the value of field_1, in this case Illinois, and assign it to say $state
It can be done with a regex. Try something like that :