title: PHP - Searching an array or handle via database queries?
body: <p>I have created an array composed of records from my MySQL database. It contains a large number of recipes including a "nested" array. </p>
  
  <p>What is the best way for me to allow users to search the array(s) for multiple terms and then only show the arrays that meet the criteria? Or should I try to build specific arrays for each search?</p>
  
  <p>Here is a sample output of the array:</p>
  
  <p>Sorry, I am not sure how to display this nicely.... </p>
  
  <pre><code>35 =&gt; 
      array (size=17)
        'id' =&gt; string '35' (length=2)
        'name' =&gt; string 'Yummy stuff!!' (length=13)
        'recipeType' =&gt; string 'Appetizer' (length=9)
        'photo' =&gt; string 'url/recipe.gif' (length=31)
        'thumbnail_uri' =&gt; string '' (length=0)
        'published' =&gt; string '2002-04-03 00:00:00' (length=19)
        'summary' =&gt; string 'The summary of the recipe is that it is really good!' (length=52)
        'review' =&gt; string 'The review of this recipe is awesome! More please!' (length=50)
        'prepTime' =&gt; string '70' (length=2)
        'cookTime' =&gt; string '30' (length=2)
        'totalTime' =&gt; string '140' (length=3)
        'nutrition' =&gt; string 'No calories here.' (length=17)
        'instructions' =&gt; string 'I instruct you to cook it long and good, until it&amp;#39;s warm' (length=60)
        'yield' =&gt; string 'It yields enough for me and you.' (length=32)
        'ingredient' =&gt; string '2 apples, one banana, and 18 lemons' (length=35)
        'author' =&gt; string 'John Sample Man' (length=12)
        'dietary_restrictions' =&gt; 
          array (size=2)
            6 =&gt; string 'Low fat' (length=7)
            7 =&gt; string 'Grain Free' (length=10)
  36 =&gt; 
      array (size=17)
        'id' =&gt; string '36' (length=2)
        'name' =&gt; string 'A good recipe' (length=13)
        'recipeType' =&gt; string 'Appetizer' (length=9)
        'photo' =&gt; string 'url/recipe.gif' (length=31)
        'thumbnail_uri' =&gt; string '' (length=0)
        'published' =&gt; string '2002-04-03 00:00:00' (length=19)
        'summary' =&gt; string 'The summary of the recipe is that it is really good!' (length=52)
        'review' =&gt; string 'The review of this recipe is awesome! More please!' (length=50)
        'prepTime' =&gt; string '70' (length=2)
        'cookTime' =&gt; string '30' (length=2)
        'totalTime' =&gt; string '140' (length=3)
        'nutrition' =&gt; string 'No calories here.' (length=17)
        'instructions' =&gt; string 'I instruct you to cook it long and good, until it&amp;#39;s warm' (length=60)
        'yield' =&gt; string 'It yields enough for me and you.' (length=32)
        'ingredient' =&gt; string '2 apples, one banana, and 18 lemons' (length=35)
        'author' =&gt; string 'John Sample Man' (length=12)
        'dietary_restrictions' =&gt; 
          array (size=2)
            4 =&gt; string 'Gluten-Free' (length=11)
            7 =&gt; string 'Grain Free' (length=10)
  </code></pre>