-1

这条线是什么意思:

$fields = explode("\r\n", preg_replace('/\x0D\x0A[\x09\x20]+/', ' ', $header));

我从这个答案cURL 得到它,将重定向 url 到一个变量

4

1 回答 1

1

将展开拆分为多行的preg_replace电子邮件标题行。然后调用会将生成的字符串拆分为一个数组,每个数组单元格有一个标题行。explode

例如,字符串:

Subject: This is a long subject
    line split across
  multiple lines
From: user@example.com

将转化preg_replace为:

Subject: This is a long subject line split across multiple lines
From: user@example.com

以下explode将为您提供:

Array(
    [0] => 'Subject: This is a long subject line split across multiple lines',
    [1] => 'From: user@example.com'
)
于 2013-01-01T16:31:10.530 回答