Top

php 5.2 Ͽ json ϱ | Web-Programing
(shinjm) | Text | 2013/02/13 19:59:50 | ȸ:3668
÷ (2)

# 
1. json_decode Լ 
2. Ŭ 
3. decode ϱ



json.php  include  Ŀ ! Ŭ մϴ.

$test = new Services_JSON();
 = $test->decode(decode , true);

̷ ϸ Ǵµ ! 
but... object Ƿ Լ ߰մϴ ! 

 Ŭ  κ  Լ ߰ ּ !

if ( !function_exists('json_decode') ){
             function json_decode($json) 
	{  
		// Author: walidator.info 2009 
		$comment = false; 
		$out = '$x='; 
		
		for ($i=0; $i<strlen($json); $i++) 
		{ 
			if (!$comment) 
			{ 
				if ($json[$i] == '{')        $out .= ' array('; 
				else if ($json[$i] == '}')    $out .= ')'; 
				else if ($json[$i] == ':')    $out .= '=>'; 
				else                        $out .= $json[$i];            
			} 
			else $out .= $json[$i]; 
			if ($json[$i] == '"')    $comment = !$comment; 
		} 
		eval($out . ';'); 
		return $x; 
	}
}
ϱ
ϱ
0
0
0


ҷ Դϴ.
[Oracle] Ŭ̾Ʈ ġ (jjinki) 2013-02-14 18:30:32
[PHP] ѱ ڿ ڸ ̰ (lkhtt) 2013-02-12 18:58:24