src/JSONObject.php
public static function stringToValue($string)
	{
		if($string == '')
		{
			return $string;
		}
		if(is_float($string))
		{
			return (float) $string;
		}
		if(is_int($string))
		{
			return (int) $string;
		}
		if(strtolower($string) == 'true')
		{
			return true;
		}
		if(strtolower($string) == 'false')
		{
			return false;
		}
		if(strtolower($string) == 'null')
		{
			return NULL;
		}
		
		return $string;
	}
public static function stringToValue($string)
	{
		if($string == '')
		{
			return $string;
		}
		if(is_float($string))
		{
			return (float) $string;
		}
		if(is_int($string))
		{
			return (int) $string;
		}
		if(strtolower($string) == 'true')
		{
			return true;
		}
		if(strtolower($string) == 'false')
		{
			return false;
		}
		if(strtolower($string) == 'null')
		{
			return NULL;
		}
		
		return $string;
	}
public static function stringToValue ( $ string ) { if ( $ string == '' ) { return $ string ; } if ( is_float ( $ string ) ) { return ( float ) $ string ; } if ( is_int ( $ string ) ) { return ( int ) $ string ; } if ( strtolower ( $ string ) == 'true' ) { return true ; } if ( strtolower ( $ string ) == 'false' ) { return false ; } if ( strtolower ( $ string ) == 'null' ) { return NULL ; } return $ string ; }
Try to convert a string into a number, boolean, or null. If the string can't be converted, return the string.

@param string A String.
@return A simple JSON value.
Try to convert a string into a number boolean or null . If the string can t be converted return the string .