如何将这个cURL命令转换为PHP(libcurl)?

如何将这个cURL命令转换为PHP(libcurl)?,php,command-line,curl,translation,Php,Command Line,Curl,Translation,在接下来的部分中,我需要哪些PHP语句来完成这项工作: curl -is -F 'J:A-login=BTDT::Action::Login' -F 'J:A:F-address-login=EMAILADDRESS' -F 'J:A:F-password-login=PASSWORD' http://hiveminder.com/splash | grep -o 'JIFTY_SID_HIVEMINDER=[0-9a-f]\+' 这些标志和字段仍然很神秘,我现在还没有时间浏览文档来弄清楚这是

在接下来的部分中,我需要哪些PHP语句来完成这项工作:

curl -is -F 'J:A-login=BTDT::Action::Login' -F 'J:A:F-address-login=EMAILADDRESS' -F 'J:A:F-password-login=PASSWORD' http://hiveminder.com/splash | grep -o 'JIFTY_SID_HIVEMINDER=[0-9a-f]\+'

这些标志和字段仍然很神秘,我现在还没有时间浏览文档来弄清楚这是如何翻译的。不过,我至少理解了
| grep…
部分。

你不需要卷曲:

$data = array(
    "J:A-login"             => 'BTDT::Action::Login',
    "J:A:F-address-login"   => 'EMAILADDRESS',
    "J:A:F-password-login"  => 'PASSWORD',
);
$context = stream_context_create(
    array( 
        'http' => array( 
            'method'  => 'POST', 
            'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
            'content' => http_build_query($data), 
            'timeout' => 10, 
        ), 
    )
);

$ret = file_get_contents('http://hiveminder.com/splash', false, $context);
if (preg_match('/JIFTY_SID_HIVEMINDER=[0-9a-f]+/m', $ret, $matches)) {
    //see $matches[0]
}

注意,这可能需要修改;在查看表单时,它似乎需要比卷发线使用的更复杂的东西。

是的,我想知道卷发业务到底是为了什么。非常感谢!