Jump to content

[SOLVED] preg_match with a /


treeleaf20

Recommended Posts

I tried:

 

$pattern = '/Content-Type: multipart/mixed; boundary="(.*)\n|$/';

 

 

but it didn't work and I know it's in there. For example this is some sample data that I want to search for:

 

From: User Name To: [email protected] Content-Type: multipart/mixed; boundary=00163631073750ac1b0475eaa507 X-Nonspam: None --00163631073750ac1b0475eaa507 Content-Type: multipart/alternative; boundary=00163631073750ac

This is the whole code I use:

 

$pattern = '/Content-Type: multipart\/mixed; boundary="(.*)\n|$/';
echo "The pattern is ".$pattern;
$id_find = array();
if (preg_match($pattern, $data, $id_find))
{
$id_look_up = $id_find[1];
    print "<br><br>The id to look up is: $id_look_up"; // That should be the rest.
} 

 

It echos the id to look up is but it doesn't echo the variable.

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.