Warning: Illegal offset type in /email_HANDLER.php on line 85
$final_message = str_replace($from, $to, $final_message);
preg_match_all('/<img[^>]+>/i',$final_message, $result);
$img = array();
foreach($result as $img_tag)
{
preg_match_all("/(alt|title|src)=('[^']*')/i",(string)$img_tag, $img[$img_tag]); //LINE 85
}
Anyone? I'm about to tear my hair out over this...
here is my var_dump of $img_tag
array(1) {
[0]=>
string(97) "<img alt='' src='http://pete1.netsos.com/site/files/newsletter/banner.jpg' align='' border='0px'>"
Assuming $img_tag
is an object of some type, rather than a proper string, cast $img_tag
to a string inside the []
preg_match_all("/(alt|title|src)=('[^']*')/i",(string)$img_tag, $img[(string)$img_tag]);
//------------------------------------------------------------------^^^^^^^^^
Some object types, notably SimpleXMLElement
for example, will return a string representation to print/echo
via the magic method __toString()
, but cannot stand in as regular strings. Attempts to use them as array keys will yield the illegal offset type
error unless you cast them to proper strings via (string)$obj
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With