title: How can I use php to search multiple key words in xml file and return the containing tag?
body: <p>I have an xml file like this, which stores video subtitles:</p>
  
  <pre><code>&lt;videos&gt;
      &lt;video&gt;
          &lt;id&gt;1&lt;/id&gt;
          &lt;enSub&gt;Hello Foo! Good morning!&lt;/enSub&gt;
          &lt;cnSub&gt;你好 Foo! 早上好！&lt;/cnSub&gt;
      &lt;/video&gt;
      &lt;video&gt;
          &lt;id&gt;2&lt;/id&gt;
          &lt;enSub&gt;Hello Bar! Good afternoon!&lt;/enSub&gt;
          &lt;cnSub&gt;你好 Bar! 下午好！&lt;/cnSub&gt;
      &lt;/video&gt;
  &lt;/videos&gt;
  </code></pre>
  
  <p>I want to search certain keywords through this xml, like I enter "hello moning" in the search text area, and the search result could find the video element with id "1".</p>
  
  <p>I guess that using php xpath can only find single keyword in the xml file, and it has to iterate through the whole tree. I'm not confident that I can write a function with good performance.</p>
  
  <p>I tried to use external resource like google custom search to search my web, but it turned out that I'm not using pages to display each video. I pass different video id as parameter to the video-play-page.</p>
  
  <p>I also thought of regular expression, but don't know how to handle the orders of keywords.</p>
  
  <p>So is there any search engine that I can use to search multiple keywords to pinpoint a video. I designed this to help my users to quickly find the video the watched.</p>
  
  <p>I googled a lot. It's really slow, sometimes I just can't access google, in my place in China here. I tried "multiple keywords search xml" as searching keywords. Maybe my English isn't intelligent enough for google to understand my intent. I hope you guys here understand my question.</p>
  
  <p>Thank you so much!!</p>