Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

LonnieD's avatar

Using Key-Value Data Stored in Database with Curly Braces?

Hello everyone. I am attempting to work with a database in which a column stores data in a key-value pair wrapped in curly braces. Data is stored as {KEY1 value1}{KEY2 value2} and so on. I am only familiar with this type of key-value formatting in the TCL language as a keyed list. I have never seen it used in any other language.

A sample database row returned from a SQL query looks like this.

| ID | Last_Name | First_Name | Detail                                |
|----|-----------|------------|---------------------------------------|
| 1  | Doe       | John       | {CITY Austin}{STATE Texas}{ZIP 76932} |

My question is, how do I convert the keyed-list pairs returned from the database into a format that can be used by PHP? For example, how would I do something simple like output the details in the row as shown below.

ID: 1
Last_Name: Doe
First_Name: John
City: Austin
State: Texas
Zip: 76932
0 likes
1 reply

Please or to participate in this conversation.