Hi,
I'm using PHP 4.4.4. I'm reading the contents of a file and then
trying to extract contents between two string tokens. Problem is,
tokens occur on different lines. It seems that regular expressions
only match one line at a time. Is there any way to make them span an
entire string? Here's what I got
$file_contents = "";
$fp = fopen($email_te mpl_file, "r");
while($line=tri m(fread($fp, 102400))) {
$file_contents .= $line;
}
fclose($fp);
$match = array();
$pattern = '/' . EMAIL_TEXT_STAR T_TOKEN . '(.*)' .
EMAIL_TEXT_END_ TOKEN . '/';
preg_match($pat tern, $file_contents, $match);
Anyway, any advice you have is greatly appreciated, - Dave
I'm using PHP 4.4.4. I'm reading the contents of a file and then
trying to extract contents between two string tokens. Problem is,
tokens occur on different lines. It seems that regular expressions
only match one line at a time. Is there any way to make them span an
entire string? Here's what I got
$file_contents = "";
$fp = fopen($email_te mpl_file, "r");
while($line=tri m(fread($fp, 102400))) {
$file_contents .= $line;
}
fclose($fp);
$match = array();
$pattern = '/' . EMAIL_TEXT_STAR T_TOKEN . '(.*)' .
EMAIL_TEXT_END_ TOKEN . '/';
preg_match($pat tern, $file_contents, $match);
Anyway, any advice you have is greatly appreciated, - Dave
Comment