Redbean 3.3.7 (Web サイトからのオールインワン ダウンロード) を使用していると思いますが、コードにバージョン番号が見つかりません。json でエンコードされたデータを受け取り、R::graph() で処理したいのですが、エラーが発生します。
$json = '{"id": "","title": "Test Article","slug": "test-article","content": "<p>This is a test article</p>"}';
$decoded = json_decode($json, true);
これは私に配列を与えます
var_dump($decoded)
array(4) {
["id"]=>
string(0) ""
["title"]=>
string(12) "Test Article"
["slug"]=>
string(12) "test-article"
["content"]=>
string(29) "<p>This is a test article</p>"
}
また
echo gettype($decoded);
「配列」を返します。
しかし、これを試すと:
$bean = R::graph($decoded);
RedBean_Exception_Security エラーが発生し、"Expected array but got :string" というメッセージが表示されます。rb.php 行 9029
私は何を間違っていますか?さらに重要なことに、どうすれば修正できますか?
ありがとう。