// Prepare the search value which will be used in SQL statement. // Arguments: // searchbox ; the value of SEARCHBOX parameter in the GetPOI request. // // Returns: // searchbox_value ; If searchbox parameter has an empty string, // return a string which is a combination of numbers, letters // and white spaces. Otherwise, return the value of searchbox parameter. function GetSearchValue ( $searchbox ) { // if $searchbox exists, prepare search value. if ( isset($searchbox) ) { // initiate searchbox value and set it to any string that consists of // numbers, letters and spaces using regular expression. $searchbox_value = ‘[0-9a-zA-Z\s]*’; // if $searchbox is not an empty string, return the $searchbox value. if ( !empty($searchbox) ) $searchbox_value = $searchbox; return $searchbox_value; } //if else { // If $searchbox does not exist, throw an exception. // throw new Exception(“searchbox parameter is not passed in GetPOI // request.”); }//else }// GetSearchValue