Combine 3 strings into one
<p>I've been trying to combine 3 strings into one and having trouble doing so.</p>

<p>the strings are below.</p>

<pre><code>$from="/2/3/4/5/6/";
$to="/30/31/32/33/34/";
$sub="/2/3/4/5/6/7/8/9/10/11/12/";#this is dynamic, ever changing past &gt; (/2/3/4/5/6/)
</code></pre>

<p>the output must look like this below.</p>

<pre><code>$output="/30/31/32/33/34/6/7/8/9/10/11/12/";
</code></pre>

<p>else if <code>$sub</code> changes like below then.</p>

<pre><code>$from="/2/3/4/5/6/";
$to="/30/31/32/33/34/";
$sub="/2/3/4/5/6/7/8/";
$output="/30/31/32/33/34/6/7/8/";
</code></pre>

<p>and else if <code>$to</code> changes then this.</p>

<pre><code>$from="/2/3/4/5/6/";
$to="/30/31/";
$sub="/2/3/4/5/6/7/8/";
$output="/30/31/6/7/8/";
</code></pre>

<p>the <code>$to</code> needs to be first, then the <code>$sub</code> at the end, minus the <code>$from</code> before the end <code>/*/(eg./6/)</code> to be combined into 1 string.</p>

<p>how is this possible?</p>
