Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to like search with in php variable/xml doc/javascript variable
    primarykey
    data
    text
    <p>I have a xml file with a node named ,in title i have a long description. how to search using any keyword and get the whole string matched ? for example i have this thing in title : </p> <blockquote> <p>"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam magna sem, fringilla in, commodo a, rutrum ut, massa. Donec id nibh eu dui auctor tempor. Morbi laoreet eleifend dolor. Suspendisse pede odio, accumsan vitae, auctor non, suscipit at, ipsum. Cras varius sapien vel lectus"</p> </blockquote> <p>and i want it to be like that if i query for "lo" then it should return all matching possibilities with lo (not only lo, the whole string__> like lorem)</p> <p>source xml :</p> <pre><code> &lt;?xml version="1.0"?&gt; &lt;catalog&gt; &lt;book id="bk101"&gt; &lt;author&gt;Gambardella, Matthew&lt;/author&gt; &lt;title&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam magna sem, fringilla in, commodo a, rutrum ut, massa. Donec id nibh eu dui auctor tempor. Morbi laoreet eleifend dolor. Suspendisse pede odio, accumsan vitae, auctor non, suscipit at, ipsum. Cras varius sapien vel lectus&lt;/title&gt; &lt;genre&gt;Computer&lt;/genre&gt; &lt;price&gt;44.95&lt;/price&gt; &lt;publish_date&gt;2000-10-01&lt;/publish_date&gt; &lt;description&gt;An in-depth look at creating applications with XML.&lt;/description&gt; &lt;/book&gt; &lt;/catalog&gt; </code></pre> <p>Php code : </p> <pre><code>&lt;form method="POST" id="searchform" action=""&gt; &lt;input type="text" name="search_text" id="search_text" /&gt; &lt;input type="submit" name="search" id="search" /&gt; &lt;/form&gt; &lt;?php $data = (array)simplexml_load_file('axx2.xml'); $data = array_pop($data); if(isset($_POST['search'])) { if($_POST['search_text']=="") { echo "please enter your search value"; exit; } } if(isset($_POST['search'])){ $equalizing_value=$_POST['search_text']; $no_of_data_in_xml=count($data); for($i='0';$i&lt;$no_of_data_in_xml;$i++) { $author=$data[$i]-&gt;author; $title=$data[$i]-&gt;title; $genre=$data[$i]-&gt;genre; $description=$data[$i]-&gt;description; }} ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload