Tricky foreach loop... how to?
<p>I am looping through a spreadsheet which may have information like so:</p>

<pre><code>To                  From
LAX/SAF/ORL         ORL/SAF
LAX/DUB             DUB/SAF
SAF/LON             LON/BNE/SYD
</code></pre>

<p>I need to loop through this info so I get something like so:</p>

<pre><code>Result 1: Lax -&gt; Orl
Result 2: Lax -&gt; Saf
Result 3: Saf -&gt; Orl
Result 4: Saf -&gt; Saf
Result 5: Orl -&gt; Orl
Result 6: Orl -&gt; Saf
</code></pre>

<p>Here is what I have so far:</p>

<pre><code>$row = "LAX/SAF/ORL";
$row2 = "ORL/SFO";
preg_match_all('([A-Za-z]+)', $row, $matches);
foreach ($matches[0] as $location_to){
    echo $location_to . " -&gt; " . $row2 . "&lt;br /&gt;"; //currently doesn't loop through row2
}
</code></pre>

<p>How can I do this but for both sets of data? I'm currently stuck how to kind of.. foreach twice like above to get the output I need.</p>

<p>Any help would be greatly appreciated (This needs to run through one loop as it is a row on a spreadsheet and has other assigned data to it).</p>

<p>It's basically a multi trip entry sort of thing.</p>

<p>Thanks</p>
