skip to Main Content

How to decode JSON data in WordPress?

for 8 hours now I have been trying to parse this jSON response data {"status":"200","message":"Welcome to spakkolos.com! You are welcome. Stay tuned"} I have tried the followig, no luck: $response = wp_remote_request( "https://loopwi.com/json"); $body = wp_remote_retrieve_body($response); $json = json_decode($body); echo…

VIEW QUESTION

Can WordPress hide null values in an array?

I have this array of parameters: $fields = [ 'idutente' => $_POST['acf']['field_60084ad3970a8'] ?? 0, 'nome' => $_POST['acf']['field_6050d30f14572'], 'cognome' => $_POST['acf']['field_6050d32614573'], 'titolo' => $_POST['acf']['field_605253f9f597d'], 'sesso' => $_POST['acf']['field_605312ee27c34'], 'ente' => $_POST['acf']['field_6048890606c82'], 'ruolo' => $_POST['acf']['field_604888fc06c81'], 'idnazione' => $_POST['acf']['field_60526f08d2fbb'], 'citta' => $_POST['acf']['field_6048897606c87'], 'provincia' =>…

VIEW QUESTION

Can Flask return a JSON array of objects?

I am working on a simple CRUD application and I can't return an array of objects in Flask. My db Model is like this: class QrRecord(db.Model): id = db.Column(db.String(256), primary_key=True) name = db.Column(db.String(128), nullable=False) date = db.Column(db.Date, nullable=False) qrType =…

VIEW QUESTION

Can’t parse JSON string w/backslash?

I have the following string (character varying) in my database: [{"MountPoint":"C:","FreeSpace":"18 GB","TotalCapacity":"39 GB","TotalBytes":42580570112,"FreeBytes":19708321792}] It is added as is to a java JSONObject than sent to the client where it failed to parse to a javascript array of objects. What I…

VIEW QUESTION

Can Delphi 10.1 extract a JSON value into multiple categories?

I have extracted the UK Gov Bank Holidays using Delphi 10.1 with TRESTClient and TRESTRequest. This is the results (cut down version): { "england-and-wales": {"division":"england-and-wales","events": [{"title":"New Year’s Day","date":"2018-01-01","notes":"","bunting":true}, {"title":"Good Friday","date":"2018-03-30","notes":"","bunting":false}, {"title":"Christmas Day","date":"2025-12-25","notes":"","bunting":true}, {"title":"Boxing Day","date":"2025-12-26","notes":"","bunting":true}]}, "scotland": {"division":"scotland","events": [{"title":"New Year’s Day","date":"2018-01-01","notes":"","bunting":true}, {"title":"2nd…

VIEW QUESTION
Back To Top
Search