删除json中的括号?

lau*_*kok 9 php json

如何摆脱下面的括号进行json处理?

[{"success":true,"filename":"bialding_and_rebialding_plymouth02.jpg"},{"success":true,"filename":"bialding_and_rebialding_plymouth03.jpg"},{"success":true,"filename":"bialding_and_rebialding_plymouth04.jpg"}]
Run Code Online (Sandbox Code Playgroud)

上面的结果由下面的类处理成一个数组,

function handle_upload($upload_directory)
    {
        # Loop the code according to the number of files.
        for($i = 1; $i <= $this->total; $i++)
        {
            ...

            if ($this->file->save($upload_directory.$name_filtered.'.'.$file_extension , $i-1))
            {
                $message[] = array('success'=>true,'filename'=>$name_filtered.'.'.$file_extension);
            }
            else 
            {
                $message[] = array('error'=> 'Could not save uploaded file.' . 'The upload was cancelled, or server error encountered');
            }
        }

        return $message;
    }
Run Code Online (Sandbox Code Playgroud)

然后我json_encode用来将数组转换成json格式,

$uploader = new uploader();
$result = $uploader->handle_upload('uploads/');

echo htmlspecialchars(json_encode($result), ENT_NOQUOTES);
Run Code Online (Sandbox Code Playgroud)

但我只在没有括号的结果中需要这个,

{"success":true,"filename":"bialding_and_rebialding_plymouth02.jpg"},{"success":true,"filename":"bialding_and_rebialding_plymouth03.jpg"},{"success":true,"filename":"bialding_and_rebialding_plymouth04.jpg"}
Run Code Online (Sandbox Code Playgroud)

S M*_*S M 22

str_replace(array('[', ']'), '', htmlspecialchars(json_encode($result), ENT_NOQUOTES));