Converting C# function to PHP
<p>Is there anyone of you who could help me a bit with this?
I have a small method in C#, that I would like to convert to PHP.
Unfortunately my knowledge of PHP is very limited.
I'm hoping someone could give me some clues of how to do this.
Just to say it, I am not looking for someone to do it for me, just help me get started.</p>

<p>This is the C# method.</p>

<pre><code>    private static string decode(string str1, string str2)
    {
        StringBuilder builder = new StringBuilder(str1);
        StringBuilder builder2 = new StringBuilder(str2);
        StringBuilder builder3 = new StringBuilder(str1.Length);
        int num = 0;
    Label_0084:
        while (num &lt; builder.Length)
        {
            int num2 = 0;
            while (num2 &lt; p1.Length)
            {
                if ((num == builder.Length) || (num2 == builder2.Length))
                {
                    goto Label_0084;
                }
                char ch = builder[num];
                char ch2 = builder2[num2];
                ch = (char)(ch ^ ch2);
                builder3.Append(ch);
                num2++;
                num++;
            }
        }
        return builder3.ToString();
    }
</code></pre>

<p>The two things I'm not at all sure about, and not even sure what to search for, is an equivialent of StringBuilder. Is there an equivialent? Or is it even needed?
And then this part:</p>

<pre><code>char ch = builder[num];
char ch2 = builder2[num2];
ch = (char)(ch ^ ch2);
builder3.Append(ch);
</code></pre>

<p>How would I replicate this in PHP?</p>

<p>Hope someone could help me shed some light over this.
Best regards,
/Rick</p>
