3v4l.org

run code in 300+ PHP versions simultaneously
<?php $attachment = '[{ "contentType": "application/json", "content": { "type": "mytype", "body": [{ "type": "TextInfo", "text": "TEST TEXT", "wrap": true }] } }]'; // Add attachment string (JSON data) in an array $mydata = array( 'space' => "abc", 'markdown' => "**welcome**", 'attachment' => json_decode($attachment) ); // Turn array into one big JSON string $send_json = json_encode($mydata, JSON_PRETTY_PRINT); echo $send_json;

preferences:
25.2 ms | 405 KiB | 5 Q