I created an array below:
$email[] = $post[0];
$email[].= $post[2];
The result is:
$email = Array ( [JESSICA] => [email protected] )
I then pass it to a class constructor as so:
$email_user = new Email($id,$email,$subject,$heading,$messages,$keys);
The class looks like this:
class Email extends Users {
protected $id;
public $strings;
public $user_email;
public $subject;
public $heading;
public $messages;
public $keys;
public function __construct($id,$user_email,$subject,$heading,$messages,$keys) {
parent::__construct($id);
$this->user_email = $user_email;
$this->subject = $subject;
$this->heading = $heading;
$this->messages = $messages;
$this->keys = $keys;
If I test to see if $this->user_email is an array using:
if(is_array($this->user_email)) {
echo "TRUE";
}
it returns false. How come?
* I found the issue, a conflict with variables both named $email. Thanks for the help.
$email[].=? You can do that?.doesn't do anything. It's the same as$email[] =.