Changing parts of a string
<p>I am making a command conversion type system and here is what I am using for example if a string is:</p>

<pre><code>if (strcmp(cmdtext, "/COMMAND", true) == 0)
</code></pre>

<p>I want to replace that however keep the string COMMAND in a variable then insert it into this string: </p>

<pre><code>CMD:COMMAND(playerid, params[])
</code></pre>

<p>How would I go about doing this in PHP I have tried using a mixture of str_replace() and sscanf()</p>

<p>If the string is something like </p>

<pre><code>if (strcmp(cmdtext, "/COMMAND", true) == 0)
    {
        Functions
        return 1;
    }
</code></pre>

<p>The brackets and everything in it will be a constant and the COMMAND will be a variable</p>
