src/Thybag/SharePointAPI.php
public function getFieldVersions ($list, $id, $field) {
	    //Ready XML
	    $CAML = '
	        <GetVersionCollection xmlns="http://schemas.microsoft.com/sharepoint/soap/">
	            <strlistID>'.$list.'</strlistID>
	            <strlistItemID>'.$id.'</strlistItemID>
	            <strFieldName>'.$field.'</strFieldName>
	        </GetVersionCollection>
	    ';

	    // Attempt to query SharePoint
	    try{
	        $rawxml = $this->soapClient->GetVersionCollection(new \SoapVar($CAML, XSD_ANYXML))->GetVersionCollectionResult->any;
	    }catch(\SoapFault $fault){
	        $this->onError($fault);
	    }

	    // Load XML in to DOM document and grab all Fields
        $dom = new \DOMDocument();
        $dom->loadXML($rawxml, (LIBXML_VERSION >= 20900) ? LIBXML_PARSEHUGE : null);
        $nodes = $dom->getElementsByTagName("Version");

        // Parse results
        $results = array();
        // Format data in to array or object
        foreach ($nodes as $counter => $node) {
            //Get Attributes
            foreach ($node->attributes as $attribute => $value) {
                $results[$counter][strtolower($attribute)] = $node->getAttribute($attribute);
            }
            //Make object if needed
            if ($this->returnType === 1) settype($results[$counter], "object");
        }
        // Add error array if stuff goes wrong.
        if (!isset($results)) $results = array('warning' => 'No data returned.');

	    return $results;
	}
public function getFieldVersions ($list, $id, $field) {
	    //Ready XML
	    $CAML = '
	        <GetVersionCollection xmlns="http://schemas.microsoft.com/sharepoint/soap/">
	            <strlistID>'.$list.'</strlistID>
	            <strlistItemID>'.$id.'</strlistItemID>
	            <strFieldName>'.$field.'</strFieldName>
	        </GetVersionCollection>
	    ';

	    // Attempt to query SharePoint
	    try{
	        $rawxml = $this->soapClient->GetVersionCollection(new \SoapVar($CAML, XSD_ANYXML))->GetVersionCollectionResult->any;
	    }catch(\SoapFault $fault){
	        $this->onError($fault);
	    }

	    // Load XML in to DOM document and grab all Fields
        $dom = new \DOMDocument();
        $dom->loadXML($rawxml, (LIBXML_VERSION >= 20900) ? LIBXML_PARSEHUGE : null);
        $nodes = $dom->getElementsByTagName("Version");

        // Parse results
        $results = array();
        // Format data in to array or object
        foreach ($nodes as $counter => $node) {
            //Get Attributes
            foreach ($node->attributes as $attribute => $value) {
                $results[$counter][strtolower($attribute)] = $node->getAttribute($attribute);
            }
            //Make object if needed
            if ($this->returnType === 1) settype($results[$counter], "object");
        }
        // Add error array if stuff goes wrong.
        if (!isset($results)) $results = array('warning' => 'No data returned.');

	    return $results;
	}
public function getFieldVersions ( $ list , $ id , $ field ) { //Ready XML $ CAML = '
	        <GetVersionCollection xmlns="http://schemas.microsoft.com/sharepoint/soap/">
	            <strlistID>' . $ list . '</strlistID>
	            <strlistItemID>' . $ id . '</strlistItemID>
	            <strFieldName>' . $ field . '</strFieldName>
	        </GetVersionCollection>
	    ' ; // Attempt to query SharePoint try { $ rawxml = $ this -> soapClient -> GetVersionCollection ( new \ SoapVar ( $ CAML , XSD_ANYXML ) ) -> GetVersionCollectionResult -> any ; } catch ( \ SoapFault $ fault ) { $ this -> onError ( $ fault ) ; } // Load XML in to DOM document and grab all Fields $ dom = new \ DOMDocument ( ) ; $ dom -> loadXML ( $ rawxml , ( LIBXML_VERSION >= 20900 ) ? LIBXML_PARSEHUGE : null ) ; $ nodes = $ dom -> getElementsByTagName ( "Version" ) ; // Parse results $ results = array ( ) ; // Format data in to array or object foreach ( $ nodes as $ counter => $ node ) { //Get Attributes foreach ( $ node -> attributes as $ attribute => $ value ) { $ results [ $ counter ] [ strtolower ( $ attribute ) ] = $ node -> getAttribute ( $ attribute ) ; } //Make object if needed if ( $ this -> returnType === 1 ) settype ( $ results [ $ counter ] , "object" ) ; } // Add error array if stuff goes wrong. if ( ! isset ( $ results ) ) $ results = array ( 'warning' => 'No data returned.' ) ; return $ results ; }
getFieldVersions
Get previous versions of field contents

@see https://github.com/thybag/PHP-SharePoint-Lists-API/issues/6#issuecomment-13793688 by TimRainey
@param $list Name or GUID of list
@param $id ID of item to find versions for
@param $field name of column to get versions for
@return array | object
getFieldVersions Get previous versions of field contents