PHP function in array
<p>My problem is that retrieveName() is not getting $1's value, but $1 is working just fine in the previous instance.</p>

<pre><code>    function bbcode ($string)
    {
    // All the default bbcode arrays.
    $bbcode = array(
    '#\[quote=(.*?)\](.*?)\[/quote\]#si' =&gt; 
'&lt;span class="bbcode_quote"&gt;&lt;b&gt;
&lt;a href="userprofile.php?id='.stripslashes('$1').'" target="_blank"&gt;
&lt;span class="fake_link"&gt;'.retrieveName('$1').'&lt;/span&gt;&lt;/a&gt; Said:&lt;/b&gt;&lt;BR/&gt;$2&lt;/span&gt;&lt;BR/&gt;'

    );
    $output = preg_replace(array_keys($bbcode), array_values($bbcode), $string);
    $output = str_replace("\\r\\n", "&lt;br&gt;", $output);
    return $output;
    }
</code></pre>

<p><strong>EDIT:</strong>
there's no strip slashes, I wish it was that simple</p>

<pre><code>function retrieveName($poster_id){
$get_name = mysql_query("SELECT * FROM users WHERE userid = 'sanitizeIn($poster_id)'")
or die(mysql_error());
$name_row = mysql_fetch_array($get_name);
return $name_row['username'];
}
function sanitizeIn ($string) {
$output = mysql_real_escape_string($string);
return $output;
}
</code></pre>
