Skip to content
Advertisement

preg_match() expects parameter 2 to be string, object given

i got this error when i’m trying to send multiple email, and i also want to pass a data to mail view.

here is my controller:

JavaScript

and here is my mail view:

JavaScript

i don’t understand where i’m doing wrong, thankyou!

Advertisement

Answer

You don’t need to wrap the result of your query in an array. Also if you only want the email field from these records you could use pluck to get a list of them:

JavaScript

This would make $recipient a string for the email address.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement