Xpath query contains

hyperscan

New Member
I have the folowing code:\[code\]$xml = simplexml_load_file($url);$query = '/root/parent[Model="Corolla"]';//RUN QUERY ON XML$xQuery = $xml->xpath($query);\[/code\]And here is the XML file:\[code\]<root> <parent> <Model>Corolla A/C</Model> </parent></root>\[/code\]This code works good if I'm searching for the exact string "Corolla". The problem I'm having is that some of the values are similar to "Corolla A/C good condition" Is there a way I can query the XML file for any Model element that contains the word Corolla rather then the exact string Corolla?EDIT: I added an example of my XML help clarify.
 
Back
Top