src/Arrays/Conversions/To/Csv.php
public function Convert($data)
	{
		// Create a file pointer
		$fp = fopen('php://temp/maxmemory:'.$this->memory*(1024*1024), 'r+');
		
		// Loop through each line
		foreach ($data as $line)
		{
			fputcsv($fp, $line, $this->delimiter, $this->enclosure);
		}
		
		// Get the CSV as a String
		rewind($fp); $csv = stream_get_contents($fp); fclose($fp);
		
		// Add the headings
		if($this->headings == true)
		{
			// Create the headings line
			$headings = '';
			foreach ($data[0] as $key => $value)
			{
				$headings .= $key.',';
			}
			
			// Remove the last comma
			$headings = substr($headings, 0, -1);
			
			// Append the headings to the csv
			$csv = $headings."\n".$csv;
		}
		
		// Return the CSV
		return $csv;
	}
public function Convert($data)
	{
		// Create a file pointer
		$fp = fopen('php://temp/maxmemory:'.$this->memory*(1024*1024), 'r+');
		
		// Loop through each line
		foreach ($data as $line)
		{
			fputcsv($fp, $line, $this->delimiter, $this->enclosure);
		}
		
		// Get the CSV as a String
		rewind($fp); $csv = stream_get_contents($fp); fclose($fp);
		
		// Add the headings
		if($this->headings == true)
		{
			// Create the headings line
			$headings = '';
			foreach ($data[0] as $key => $value)
			{
				$headings .= $key.',';
			}
			
			// Remove the last comma
			$headings = substr($headings, 0, -1);
			
			// Append the headings to the csv
			$csv = $headings."\n".$csv;
		}
		
		// Return the CSV
		return $csv;
	}
/*
Method: Convert
=========================================================================
This will do the actual converting

Parameters:
-------------------------------------------------------------------------
$data - An array to convert to CSV

Returns:
-------------------------------------------------------------------------
csv