src/Thybag/SharePointAPI.php
private function whereXML (array $q) {
		$queryString = '';
		$counter = 0;

		foreach ($q as $col => $value) {
			$counter++;
			$queryString .= '<Eq><FieldRef Name="' . $col . '" /><Value Type="Text">' . htmlspecialchars($value) . '</Value></Eq>';

			// Add additional "and"s if there are multiple query levels needed.
			if ($counter >= 2) {
				$queryString = '<And>' . $queryString . '</And>';
			}
		}

		return '<Where>' . $queryString . '</Where>';
	}
private function whereXML (array $q) {
		$queryString = '';
		$counter = 0;

		foreach ($q as $col => $value) {
			$counter++;
			$queryString .= '<Eq><FieldRef Name="' . $col . '" /><Value Type="Text">' . htmlspecialchars($value) . '</Value></Eq>';

			// Add additional "and"s if there are multiple query levels needed.
			if ($counter >= 2) {
				$queryString = '<And>' . $queryString . '</And>';
			}
		}

		return '<Where>' . $queryString . '</Where>';
	}
private function whereXML ( array $ q ) { $ queryString = '' ; $ counter = 0 ; foreach ( $ q as $ col => $ value ) { $ counter ++ ; $ queryString .= '<Eq><FieldRef Name="' . $ col . '" /><Value Type="Text">' . htmlspecialchars ( $ value ) . '</Value></Eq>' ; // Add additional "and"s if there are multiple query levels needed. if ( $ counter >= 2 ) { $ queryString = '<And>' . $ queryString . '</And>' ; } } return '<Where>' . $ queryString . '</Where>' ; }
Query XML
Generates XML for WHERE Query

@param Array $q array('<col>' => '<value_to_match_on>')
@return XML DATA
Query XML Generates XML for WHERE Query