Extracting info from a line:
Posted: Sat May 21, 2005 12:25 pm
I have a text file which contains lines with the following form.
What I would like to have as a result:
Can I somehow make a 2d array with a preg_match pattern?
Code: Select all
(9911) 05/10/05 1-2-7-4Code: Select all
Array
(
ї0] => (9919) 05/18/05 8-0-0-9
ї0] => 9919
ї1] => 05/18/05
ї2] => Array
(
ї0] => 8
ї1] => 0
ї2] => 0
ї3] => 9
)
)Code: Select all
$regex = "e;#^\((\d{1,4})\)\t\t(\d\d/\d\d/\d\d)\t((\d)-(\d)-(\d)-(\d))#"e;;
preg_match( $regex, $pick, $parts );Code: Select all
Array
(
ї0] => (9919) 05/18/05 8-0-0-9
ї1] => 9919
ї2] => 05/18/05
ї3] => 8-0-0-9
ї4] => 8
ї5] => 0
ї6] => 0
ї7] => 9
)