I am pulling a selection from a database that is a text type so it can be very long of an text entry. I need to pull out a name after a qualifier "From:" in the beggining, the first time it encounters it.
$row = "[12/09/04][09:36PM][From:TheName] - This could be a long text message blabla bla.";
I need to pull out TheName from that, and stop after that. I don't want anyone to be able to type in the message body [From:AName] and have my code pull that name too.
How could I go about doing this? Thank you in advance for any help.
Edit: I could cut the first part of the string (all being same in lenght) then pull up to the "]" to get the name but some messages don't include the first part (these messages I don't need to extract a name from) so I think a pattern match would be better because I could check to see if it matches the pattern before even running any other operations to extract the name?