PDA

View Full Version : help: extracting data from calendar custom fields


squeezerbabe
01-30-2012, 03:23 PM
Hi

Total PHP newbie here so really stuck and would appreciate any help!! :confused:

I have created some custom fields to my calendar - basically event type, location and time.

These are stored in the "event" entity in the field "customfields" as follows:-

a:3:{i:4;s:7:"Concert";i:5;s:29:"Town Hall";i:6;s:3:"20:00";}

I've now created a page where I want to display these details. I can get the date and event title to show ok but when I add the customfield I'm obviously getting all the codes too.

How do I seperate this field so that I end up with Concert, Town Hall, 20:00 in variables so that I can output these on my page were required.

Thanks in anticipation of an answer :confused:

kh99
01-30-2012, 07:06 PM
That string is a serialized array, so you'd run the value through the unserialize() php function, and the result should be an array of 3 strings.

squeezerbabe
01-31-2012, 08:13 AM
many, many thanks - will try that.

Appreciate you taking the time to answer.

ProFifaLeagues
01-31-2012, 12:55 PM
If you manage to get this Going it would be great to see it in action mate,Something Vbulletin needs as default