src/ADT/JSON/Builder.php
public function get( $key, $value, $parent = NULL )
	{
		$type	= self::getType( $key, $value );
		switch( $type )
		{
			case 'object':
				$value	= '{'.self::loop( $value, $type ).'}';
				break;
			case 'array':
				$value	= '['.self::loop( $value, $type ).']';
				break;
			case 'number':
				$value	= $value;
				break;
			case 'string':
				$value	= '"'.self::escape( $value ).'"';
				break;
			case 'boolean':
				$value	= $value ? 'true' : 'false';
				break;
			case 'null':
				$value	= 'null';
				break;
		}
		if( !is_null( $key ) && $parent != 'array' )
			$value	= '"'.$key.'":'.$value;
		return $value;
	}
public function get( $key, $value, $parent = NULL )
	{
		$type	= self::getType( $key, $value );
		switch( $type )
		{
			case 'object':
				$value	= '{'.self::loop( $value, $type ).'}';
				break;
			case 'array':
				$value	= '['.self::loop( $value, $type ).']';
				break;
			case 'number':
				$value	= $value;
				break;
			case 'string':
				$value	= '"'.self::escape( $value ).'"';
				break;
			case 'boolean':
				$value	= $value ? 'true' : 'false';
				break;
			case 'null':
				$value	= 'null';
				break;
		}
		if( !is_null( $key ) && $parent != 'array' )
			$value	= '"'.$key.'":'.$value;
		return $value;
	}
public function get ( $ key , $ value , $ parent = NULL ) { $ type = self :: getType ( $ key , $ value ) ; switch ( $ type ) { case 'object' : $ value = '{' . self :: loop ( $ value , $ type ) . '}' ; break ; case 'array' : $ value = '[' . self :: loop ( $ value , $ type ) . ']' ; break ; case 'number' : $ value = $ value ; break ; case 'string' : $ value = '"' . self :: escape ( $ value ) . '"' ; break ; case 'boolean' : $ value = $ value ? 'true' : 'false' ; break ; case 'null' : $ value = 'null' ; break ; } if ( ! is_null ( $ key ) && $ parent != 'array' ) $ value = '"' . $ key . '":' . $ value ; return $ value ; }
Returns a representative String for a Data Pair.
@access		public
@param		string		$key			Key of Pair
@param		mixed		$value			Value of Pair
@param		string		$parent			Parent of Pair
@return		string
Returns a representative String for a Data Pair .