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@email.com Content-Type: multipart/mixed; boundary=00163631073750ac1b0475eaa507 X-Nonspam: None --00163631073750ac1b0475eaa507 Content-Type: multipart/alternative; boundary=00163631073750ac

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.