1--TEST-- 2PostgreSQL pg_convert() and JSON/Array 3--SKIPIF-- 4<?php 5include("skipif.inc"); 6skip_server_version('9.2'); 7?> 8--FILE-- 9<?php 10error_reporting(E_ALL); 11 12include 'config.inc'; 13 14$db = pg_connect($conn_str); 15 16$fields = array( 17 'textary'=>'{"meeting", "lunch", "training", "presentation"}', 18 'jsn'=>'{"f1":1,"f2":"foo"}', 19); 20$converted = pg_convert($db, $table_name_92, $fields); 21var_dump($converted); 22 23if (!pg_insert($db, $table_name_92, $fields)) { 24 echo "Error\n"; 25} else { 26 echo "OK\n"; 27} 28 29?> 30--EXPECT-- 31array(2) { 32 [""textary""]=> 33 string(51) "E'{"meeting", "lunch", "training", "presentation"}'" 34 [""jsn""]=> 35 string(22) "E'{"f1":1,"f2":"foo"}'" 36} 37OK 38