Forum Moderators: coopster
the file is like a report text file in which certain titles are repeated...
=====================================================
U-UMID = OBKTRUS33XXX940ST041839435092312
Suffix = 040710
Status =
Read-Only
Format = Swift Sub-Format = Output
<b>Msg Type = 940</b> Nature = Financial
<b>Sender</b> =
BETRES33RAX</b> LT : A
DEUTSCHE BANK TRUST COMPANY AMERICAS
NEW YORK,NY 10004
NEW YORK,NY
US
UNITED STATES
<b>Receiver</b> =
ADFHEKKAADC</b> LT : A
BANK NAME
Address
=======================================================
the text file having bold fields will be repeated again and again
i was thinking to use preg_match_all to extract the bold fields and put them in database
can u help me this regard that which method will be useful for me
i tried preg_match_all liked that
preg_match_all ("(U-UMID)", $alltext, $matches);
its extracitng all matches of "U-UMID" but when i add another searching string like that
preg_match_all ("(U-UMID)(Sender)", $alltext, $matches);
then it doesnt print anything..kindly help me for this
thanks
-adnan
$patterns = "/<b>(.*)<\/b>/Uis";The pattern says find any opening bold tag, followed by zero or more of anything, followed by any closing bold tag and put the stuff in between the tags into an array called $matches.
preg_match_all($patterns, $input, $matches);
// Wanna see what you get?
print '<pre>'; print_r($matches); exit('</pre>');
The
Uismodifiers tell it to