Fig. 5: Detail of the smart computer form and the three businesses with shops that it
will be querying
The first thing to do is to split the string into its two parts, namely the search criteria and
the shops we will be searching through. The first function defined in multishop.php
takes in the raw query string and splits it up into two arrays. The criteria array ($mcrits[])
is a plain two dimensional array or, in simpler terms, an array of pairs.
Array (
[0] => Array (
[0] => MAKE
[1] => compaq
)
[1] => Array (
[0] => PRICE
[1] => 2500
)
)
The second array ($shops[]), is an array of the locations of each of the XML files.
39