Tôi đang cố trích xuất From:address
từ nội dung email. Dưới đây là những gì tôi có cho đến thời điểm này:Làm thế nào để preg_match lần xuất hiện đầu tiên trong một chuỗi
$string = "From: [email protected] This is just a test.. the original message was sent From: [email protected]";
$regExp = "/(From:)(.*)/";
$outputArray = array();
if (preg_match($regExp, $string, $outputArray)) {
print "$outputArray[2]";
}
Tôi muốn nhận địa chỉ email của lần xuất hiện đầu tiên là From: ..
bất kỳ đề xuất nào?
tuyệt vời !, cảm ơn rất nhiều bro. Nhiều đánh giá cao – samjones39