Translating this Pseudo-code into PHP
<p>I am trying to code a function that basically gets a "property" from a sentence. These are the parameters.</p>

<pre><code>$q = "this apple is of red color"; OR $q = "this orange is of orange color";
$start = array('this apple', 'this orange');
$end = array('color', 'color');
</code></pre>

<p>and this is the function I am trying to make:</p>

<pre><code>function prop($q, $start, $end)
{
   /*
    if $q (the sentence) starts with any of the $start
    and/or ends with any of the end
    separate to get "is of red"
   */

}
</code></pre>

<p>not only am I having problems with the code itself, I am also not sure how to search that if any of the array values start with (not just contains) the $q provided.</p>

<p>Any input would be helpful.
Thanks</p>
