json format チェック php
[hachimitsu@idcf5 json_chec]$ php json_chec2.php  1
json oooo! 
stdClass Object
(
    [type] => Blog
    [profile] => stdClass Object
        (
            [name] => Syncer
            [published] => 2014-06-10
        )
)
[hachimitsu@idcf5 json_chec]$ 
[hachimitsu@idcf5 json_chec]$ php json_chec2.php 2
json oooo! 
object(stdClass)#1 (2) {
  [ type ]=>
  string(4)  Blog 
  [ profile ]=>
  object(stdClass)#2 (2) {
    [ name ]=>
    string(6)  Syncer 
    [ published ]=>
    string(10)  2014-06-10 
  }
}
[hachimitsu@idcf5 json_chec]$ 
[hachimitsu@idcf5 json_chec]$ cat jso
json_chec.php   json_chec2.php  
[hachimitsu@idcf5 json_chec]$ cat json_chec2.php 
<?php
$output_format = $argv[1] ;
// argv = 1 print_r
// argv = 2 var_dup
$json =  {
         type :  Blog  
         profile : {
                 name :  Syncer  
                 published :  2014-06-10 
        }
}   ;
$json_obj = json_decode($json) ;
//var_dump(json_decode($json)); 
//print_r(json_decode($json) true); 
//echo  [  . json_decode($json) .  ]  ; 
if( $json_obj == null ) { 
echo  json error! ¥n  ;
} else {
echo  json oooo! ¥n  ;
//var_dump($json_obj) ;
//print_r($json_obj true) ;
if( $output_format ==  1  ) {
print_r($json_obj) ;
} else {
var_dump($json_obj) ;
}
}
?>
[hachimitsu@idcf5 json_chec]$ 
curl -X POST -H  Content-Type: application/json  http://localhost:3000/comments -d @comment.json 
curl -H  Content-Type: application/json  -d  { root :[{ title : テスト1    url :  http://examples.com/test1 }  { title : テスト2    url : http://examples.jp/test2 }]}  http://api.examples.com/postjson.php
json format checkを apibaseとかにいれよう
エラーですぎ ださなようにする
phpstormデバッグいれる
全部にorder しょ いれる default設定