search for string from array in another array
<p>I have two arrays one with OS's such as Ubuntu and Windows and another with system templates like Ubuntu 5.3 blah blah and Windows XP SP2 blah blah and I need to extract the OS from the system templates array, however it is not always at the start, sometimes it is in the middle or at the end. So how could I loop through one array and check to see if it is there in another array, if so tell me what the OS is.</p>

<p>Example.</p>

<p>OS List</p>

<pre><code>$os = array("Ubuntu", "Debian", "Gentoo", "Windows", "Fedora", "CentOS", "CloudLinux", "Slackware");
</code></pre>

<p>Small section of the list of system templates (this will be in an array)</p>

<pre><code>Ubuntu 8.04 x64 LAMP Installation
Ubuntu 8.04 x64 MySQL Installation
Ubuntu 8.04 x64 PHP Installation
x64 Installation Gentoo
Basic Installation Ubuntu 8.03
</code></pre>

<p>Which would result give me</p>

<pre><code>Ubuntu
Ubuntu
Ubuntu
Gentoo
Ubuntu
</code></pre>

<p>Thanks</p>
