If you are not using dataType : 'json', you might need to do stripslashes

$.post(window.data.baseUrl, {posts : JSON.stringify(posts)});

And in php:

$posts = json_decode(stripslashes($_POST['posts']));
Answer from Evalds Urtans on Stack Overflow
🌐
GitHub
github.com › KatsuoRyuu › php-JsonStableStringify
GitHub - KatsuoRyuu/php-JsonStableStringify
string JsonStableStringify->stringify(mixed obj [, Array opts]); Return a deterministic stringified string str from the object/array obj. If opts is given, you can supply an opts['cmp'] to have a custom comparison function for object keys.
Author   KatsuoRyuu
🌐
PHP
php.net › manual › en › function.json-decode.php
PHP: json_decode - Manual
Takes a JSON encoded string and converts it into a PHP value.
🌐
Code Beautify
codebeautify.org › unstringify-json-online
Unstringify JSON Online
Unstringify JSON is easy to use tool to create a valid json string from stringified JSON data.
Find elsewhere
🌐
W3Schools
w3schools.com › js › js_json_stringify.asp
JSON.stringify()
You can convert any JavaScript datatype into a string with JSON.stringify().
🌐
Attacomsian
attacomsian.com › blog › json-parse-stringify
Understanding JSON.parse() and JSON.stringify()
October 3, 2022 - Originally derived from JavaScript, ... Python, C#, PHP, and Ruby. JSON is a natural choice to use as a data format for JavaScript asynchronous operations. The JSON object has two important methods for transforming and storing JSON data: parse() and stringify()....
🌐
Stack Overflow
stackoverflow.com › questions › 57305015 › trying-to-reverse-some-json-data
php - Trying to reverse some json data - Stack Overflow
I can successfully output data from a JSON array to a web page, but I'm trying to reverse the output. I've tried altering the foreach string to out $result['calls'] <?php $getfile = file_get_contents('call.json'); $jsonfile = json_decode($getfile); $result['calls'] = array_reverse($result['calls']); ?> <a href="call_add.php">Nieuwe call toevoegen</a><br><br> <table align="center"> <tbody> <?php foreach ($jsonfile->calls as $index => $obj): ?> ...
🌐
Testmu
testmu.ai › home › free tools › json stringify online
JSON Stringify Online | Free online tool to Stringify JSON
Use JSON.stringify when converting JavaScript objects to a JSON string for data transmission or storage. It's essential for interoperability and sending data to servers. ... JSON Prettify JSON Minify HTML Prettify HTML Minify JS Minify CSS Minify CSS Prettify XML Minify XML Prettify JS Obfuscator YAML Formatter & Beautifier SQL Formatter & Beautifier SQL Minify JS Beautifier Lua Beautifier PHP Formatter Python Formatter & Beautifier Online JSON Compare Text Compare XML Compare YAML Compare
🌐
PHPpot
phppot.com › php › json-handling-with-php-how-to-encode-write-parse-decode-and-convert
JSON Handling with PHP: How to Encode, Write, Parse, Decode and Convert - PHPpot
This is the reverse process of the above section. JavaScript supports this conversion by using its built-in JSON.stringify method.
🌐
Designcise
designcise.com › web › tutorial › what-is-the-opposite-of-the-javascript-json-stringify-method
What Is the Opposite of the JavaScript JSON.stringify() Method? - Designcise
January 4, 2022 - The opposite of the JavaScript JSON.stringify() method is JSON.parse(), which parses a JSON string and constructs JavaScript value or object from it. For example: const obj = { width: 25, height: 25 }; const str = JSON.stringify(obj); // ...
🌐
W3Schools
w3schools.com › js › js_json_php.asp
JSON PHP
Before you send the request to the server, convert the JSON object into a string and send it as a parameter to the url of the PHP page: Use JSON.stringify() to convert the JavaScript object into JSON:
🌐
W3Schools
w3schools.com › jsref › jsref_stringify.asp
JavaScript JSON stringify() Method
/*Insert the word SPACE for each white space:*/ var obj = { "name":"John", "age":"39", "city":"New York"}; var text = JSON.stringify(obj, null, "SPACE"); Try it Yourself » ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
JSON Formatter
jsonformatter.org › json-stringify-online
JSON Stringify Online using JSON.Stringify()
Secure JSON Stringify Online to create JSON String value with https and easiest way to JSON.Stringify() online.