Jump to content

parsing help


dflow

Recommended Posts

What is the output if you put

var_dump($matches);

 

23array(2) { [0]=> array(23) { [0]=> string(38) "to:references:date:message-id:subject:" [1]=> string(38) "to:references:date:message-id:subject:" [2]=> string(38) "to:references:date:message-id:subject:" [3]=> string(38) "to:references:date:message-id:subject:" [4]=> string(38) "to:references:date:message-id:subject:" [5]=> string(62) "to:[email protected]">[email protected]>
Subject:" [6]=> string(62) "to:[email protected]">[email protected]
Subject:" [7]=> string(38) "to:references:date:message-id:subject:" [8]=> string(38) "to:references:date:message-id:subject:" [9]=> string(62) "to:[email protected]">[email protected]>
Subject:" [10]=> string(62) "to:[email protected]">[email protected]
Subject:" [11]=> string(38) "to:references:date:message-id:subject:" [12]=> string(62) "to:[email protected]">[email protected]>
Subject:" [13]=> string(38) "to:references:date:message-id:subject:" [14]=> string(62) "to:[email protected]">[email protected]
Subject:" [15]=> string(38) "to:references:date:message-id:subject:" [16]=> string(38) "to:references:date:message-id:subject:" [17]=> string(38) "to:references:date:message-id:subject:" [18]=> string(62) "to:[email protected]">[email protected]>
Subject:" [19]=> string(62) "to:[email protected]">[email protected]
Subject:" [20]=> string(38) "to:references:date:message-id:subject:" [21]=> string(38) "to:references:date:message-id:subject:" [22]=> string(62) "to:[email protected]">[email protected]
Subject:" } [1]=> array(23) { [0]=> string(27) "references:date:message-id:" [1]=> string(27) "references:date:message-id:" [2]=> string(27) "references:date:message-id:" [3]=> string(27) "references:date:message-id:" [4]=> string(27) "references:date:message-id:" [5]=> string(51) "[email protected]">[email protected]>
" [6]=> string(51) "[email protected]">[email protected]
" [7]=> string(27) "references:date:message-id:" [8]=> string(27) "references:date:message-id:" [9]=> string(51) "[email protected]">[email protected]>
" [10]=> string(51) "[email protected]">[email protected]
" [11]=> string(27) "references:date:message-id:" [12]=> string(51) "[email protected]">[email protected]>
" [13]=> string(27) "references:date:message-id:" [14]=> string(51) "[email protected]">[email protected]
" [15]=> string(27) "references:date:message-id:" [16]=> string(27) "references:date:message-id:" [17]=> string(27) "references:date:message-id:" [18]=> string(51) "[email protected]">[email protected]>
" [19]=> string(51) "[email protected]">[email protected]
" [20]=> string(27) "references:date:message-id:" [21]=> string(27) "references:date:message-id:" [22]=> string(51) "[email protected]">[email protected]
" } } Array ( [0] => Array ( [0] => to:references:date:message-id:subject: [1] => to:references:date:message-id:subject: [2] => to:references:date:message-id:subject: [3] => to:references:date:message-id:subject: [4] => to:references:date:message-id:subject: [5] => to:[email protected]">[email protected]>
Subject: [6] => to:[email protected]">[email protected]
Subject: [7] => to:references:date:message-id:subject: [8] => to:references:date:message-id:subject: [9] => to:[email protected]">[email protected]>
Subject: [10] => to:[email protected]">[email protected]
Subject: [11] => to:references:date:message-id:subject: [12] => to:[email protected]">[email protected]>
Subject: [13] => to:references:date:message-id:subject: [14] => to:[email protected]">[email protected]
Subject: [15] => to:references:date:message-id:subject: [16] => to:references:date:message-id:subject: [17] => to:references:date:message-id:subject: [18] => to:[email protected]">[email protected]>
Subject: [19] => to:[email protected]">[email protected]
Subject: [20] => to:references:date:message-id:subject: [21] => to:references:date:message-id:subject: [22] => to:[email protected]">[email protected]
Subject: ) [1] => Array ( [0] => references:date:message-id: [1] => references:date:message-id: [2] => references:date:message-id: [3] => references:date:message-id: [4] => references:date:message-id: [5] => [email protected]">[email protected]>
[6] => [email protected]">[email protected]
[7] => references:date:message-id: [8] => references:date:message-id: [9] => [email protected]">[email protected]>
[10] => [email protected]">[email protected]
[11] => references:date:message-id: [12] => [email protected]">[email protected]>
[13] => references:date:message-id: [14] => [email protected]">[email protected]
[15] => references:date:message-id: [16] => references:date:message-id: [17] => references:date:message-id: [18] => [email protected]">[email protected]>
[19] => [email protected]">[email protected]
[20] => references:date:message-id: [21] => references:date:message-id: [22] => [email protected]">[email protected]
) ) 

after preg_match_all?

Link to comment
https://forums.phpfreaks.com/topic/236628-parsing-help/#findComment-1217436
Share on other sites

 

why do i get "Invalid argument supplied for foreach"

 

preg_match_all creates an array and populates it with data for you.

 

You are getting 23.

Are you commenting out everything that you added in?

Is there a count() somewhere in the script?

 

It looks like you are performing regex searches on the plain text output you see in a browser and you had said that it is in HTML. Could you either post the source of your email file, a line of the source in that file or send it to me through PM?

Link to comment
https://forums.phpfreaks.com/topic/236628-parsing-help/#findComment-1217468
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.