src/JSONObject.php
public function write()
	{
		//var_dump($this->map);die();
		$returnstring = '{';
		
		foreach($this->map as $key => $value)
		{
			$returnstring .= '"' . $key . '":';
			
			if($value instanceof JSONObject || $value instanceof JSONArray)
				$returnstring .= $value->write();
			elseif(gettype($value) == 'integer' || gettype($value) == 'double')
				$returnstring .= $value;
			elseif(gettype($value) == 'boolean')
				$returnstring .= (($value) ? 'true' : 'false');
			elseif(gettype($value) == 'NULL')
				$returnstring .= 'null';
			elseif(gettype($value) == 'string')
				$returnstring .= '"' . $value . '"';
			else
				throw new JSONException('Invalid type ' . gettype($value));
			
			if($value !== end($this->map)) $returnstring .= ',';
		}
		
		$returnstring .= '}';
		
		return $returnstring;
	}
public function write()
	{
		//var_dump($this->map);die();
		$returnstring = '{';
		
		foreach($this->map as $key => $value)
		{
			$returnstring .= '"' . $key . '":';
			
			if($value instanceof JSONObject || $value instanceof JSONArray)
				$returnstring .= $value->write();
			elseif(gettype($value) == 'integer' || gettype($value) == 'double')
				$returnstring .= $value;
			elseif(gettype($value) == 'boolean')
				$returnstring .= (($value) ? 'true' : 'false');
			elseif(gettype($value) == 'NULL')
				$returnstring .= 'null';
			elseif(gettype($value) == 'string')
				$returnstring .= '"' . $value . '"';
			else
				throw new JSONException('Invalid type ' . gettype($value));
			
			if($value !== end($this->map)) $returnstring .= ',';
		}
		
		$returnstring .= '}';
		
		return $returnstring;
	}
public function write ( ) { //var_dump($this->map);die(); $ returnstring = '{' ; foreach ( $ this -> map as $ key => $ value ) { $ returnstring .= '"' . $ key . '":' ; if ( $ value instanceof JSONObject || $ value instanceof JSONArray ) $ returnstring .= $ value -> write ( ) ; elseif ( gettype ( $ value ) == 'integer' || gettype ( $ value ) == 'double' ) $ returnstring .= $ value ; elseif ( gettype ( $ value ) == 'boolean' ) $ returnstring .= ( ( $ value ) ? 'true' : 'false' ) ; elseif ( gettype ( $ value ) == 'NULL' ) $ returnstring .= 'null' ; elseif ( gettype ( $ value ) == 'string' ) $ returnstring .= '"' . $ value . '"' ; else throw new JSONException ( 'Invalid type ' . gettype ( $ value ) ) ; if ( $ value !== end ( $ this -> map ) ) $ returnstring .= ',' ; } $ returnstring .= '}' ; return $ returnstring ; }
Returns the contents of the JSONObject as a JSONString. For compactness, no whitespace is added.

@return string
Returns the contents of the JSONObject as a JSONString . For compactness no whitespace is added .