I want to replace a text as below.
$text = '<!DOCTYPE html>
<html>
<head>
</head>
<body>
<pre><code>[[EXAMPLE]] this is a text. <br />[[EXAMPLE2]]</code></pre>
<p style="text-align: center;"><br /><br /></p>
</body>
</html>';
$products['type'] = 1;
$products['quantity'] = 2300.0;
$products['grade'] = null;
$searchVal = array(
'[[EXAMPLE]]'
'[[EXAMPLE2]]'
);
$replaceVal = array(
'replace word',
$products
);
$text = str_replace($searchVal, $replaceVal, $text);
I did not run this code. This fail is "Array to string conversion"
How can i do this.