Replace certain part of a php string
<p>I have some text <em>(in this specific case <code>$expression</code>)</em>, sometimes it is quite long. I want to output the text the same way it is, except outputting <code>numbers %</code> bold. Sometimes its spelled like <code>3%</code> and sometimes there's a space like <code>123 %</code>.</p>

<pre><code>&lt;?php
$expression = 'here we got a number 23 % and so on';
$tokens = "([0-9]+)[:space:]([\%])";
$pattern = '/[0-9][0-9] %/';

$keyword = array($pattern);
$replacement = array("&lt;b&gt;$keyword&lt;/b&gt;");
echo preg_replace($keyword, $replacement, $expression);
?&gt;
</code></pre>

<p>This is what I have but I'm not exactly sure what I'm doing wrong. It outputs an error on the line <code>$replacement = array("&lt;b&gt;$keyword&lt;/b&gt;");</code> and then outputs the actual string except it replaces the <code>number%</code> with <code>&lt;b&gt;Array&lt;/b&gt;</code>.</p>
