implode array and store as complete string based on positions of another array
<p>I have four arrays: <code>$text[], $ytext[], $titles[], $ytitles[]</code></p>

<p>What I want to do is implode the arrays, text and titles, by " " to store them as a complete string. But I want to arrange them based on their position (which is a y coordinate integer).</p>

<p>For example : </p>

<pre><code>$text[] = 
{1 =&gt; hello
2=&gt;   again
3 =&gt; more text
}

$ytext[] = 
{1 =&gt; 5
2=&gt;  10
3 =&gt; 14
}

$titles[] = 
{1=&gt; title
2=&gt; title2
}

$ytitles[] = 
{1=&gt; 2
2=&gt; 11
}
</code></pre>

<p>SO this would look like: <code>title hello again title2 more text</code></p>
