I am trying to json encode an array,it does encode but i get lots of errors:
$products = array( array( Title => "rose",
Price => "1.25,1.31,1.54,1.39",
Type => "dropdown"
),
array( Title => "daisy",
Price => "0.75",
Type => "text_field",
),
array( Title => "orchid",
Price => "1.15",
Type => "text_field"
)
);
echo json_encode($products);
I get the following errors.
Notice: Use of undefined constant Title - assumed 'Title' in C:\wamp\www\serializer.php on line 2
Notice: Use of undefined constant Price - assumed 'Price' in C:\wamp\www\serializer.php on line 3
Notice: Use of undefined constant Type - assumed 'Type' in C:\wamp\www\serializer.php on line 4
Notice: Use of undefined constant Title - assumed 'Title' in C:\wamp\www\serializer.php on line 6
Notice: Use of undefined constant Price - assumed 'Price' in C:\wamp\www\serializer.php on line 7
Notice: Use of undefined constant Type - assumed 'Type' in C:\wamp\www\serializer.php on line 8
Notice: Use of undefined constant Title - assumed 'Title' in C:\wamp\www\serializer.php on line 10
Notice: Use of undefined constant Price - assumed 'Price' in C:\wamp\www\serializer.php on line 11
Notice: Use of undefined constant Type - assumed 'Type' in C:\wamp\www\serializer.php on line 12