Jump to content

How do I display this array


PeggyBuckham

Recommended Posts

I used a plugin to create the data in a database, now I am displaying the data and writing code to search/sort. My problem is that I am not familiar with arrays that are put into a single field in a database. I’m not even sure of the correct “name” for data in this format so I can find info about it and learn. So it anyone could please direct me to as tutorial or documentation about this. I would appreciate it. Here is a sample of the code contained in one field of the database.

 

Ultimately I will need to display this data with a <br/> seperateing each element in the array. I also need to understand it better so I can search the fields that are displayed this way. I also really want to learn about it, because I believe it is fairly common and I should understand it  :)

 

a:4:{i:0;s:32:"Green";i:1;s:26:"Red";i:2;s:31:"Blue";i:3;s:33:"Yellow";}

 

Link to comment
https://forums.phpfreaks.com/topic/264395-how-do-i-display-this-array/
Share on other sites

Thank You!!! I was a little desperate so I asked the question on a couple of other forums. Here is a little more inforation that might help out the next person

    * "a:4" says what follows will be an array with 4 elements

    * "i:0" says this is the 0th index in the array

    * "s:32" says what comes next is a string

    * "Green" is that string

    * the rest just follows this pattern

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.