I have the following array output:
Array ( [0] => stdClass Object ( [name] => asdasd [email] => [email protected] [message] => asdasd ) ) Which is given by the following code:
if(isset($_POST['emailContent'])){ $mail = new PHPMailer; $emailContent = $_POST['emailContent']; $emailContent = json_decode($emailContent); print_r($emailContent); } I need to access the actual object and get the info from name, email and message.
How can I do this?
I have tried
$name = $emailContent[name]; $name = $emailContent['name']; but no luck so far. Any ideas what I might be doing wrong?
$emailContent[0]->name$emailContent.name;or$emailContent->name;?