I have an array such as below:
$import_emails = [];
$import_emails[] = [
'to' => $to,
'from' => $from,
'cc' => $cc,
'subject' => $subject,
'text' => $text,
'date' => date('Y-m-d H:i:s', strtotime($date))
];
Example array data:
Array
(
[0] => Array
(
[to] => [email protected]
[from] => babboe1 babboe1 <[email protected]>
[cc] =>
[subject] => Test Subject
[text] => Test content.
Please, write me later
Thanks!
[date] => 2017-06-29 18:04:53
)
[1] => Array
(
[to] => Anastasia Gorobets <[email protected]>
[from] => babboe1 babboe1 <[email protected]>
[cc] => [email protected]
[subject] => Tema
[text] => Bla bla bla
Test email! :)
[date] => 2017-07-02 11:55:50
)
)
How can I check if a value, for example 'nastya' exists in array item ['to']? Is there maybe some function for it?
foreach+strpos- try something on your own. If you've problems, edit your question with what you've tried.array_filter()andarray_search(). That should give you some ideas