如何从PHP中获取此对象的电子邮件变量?
$data = $_POST["data"];
$data
的内容:
Object {email: "peter.m@gmail.com"}
答案 0 :(得分:2)
也许这是一个json字符串? 尝试:
$data = json_decode($data);
$email = $data->email;
答案 1 :(得分:0)
这应该有效"
$email_string = $data->email; //should work
// or
$email_string = $data['email']; //might also work