![]() |
Extracting Custom Calendar Fields from Database in PHP
Hi
I have some custom fields in my vbulletin calendar which I'd like to show on a non-vb page. Since the all the custom field information is held in a long string, the only way I can think of extracting, in the case of the example below is by using strpos and substr. Code:
a:2:{i:1;s:19:"Birmingham, England";i:2;s:5:"88248";} Code:
$location = substr($row_Events['customfields'], strpos($row_Events['customfields'],"\"")+1, strpos($row_Events['customfields'],"\"", strpos($row_Events['customfields'],"\"")+1)-strpos($row_Events['customfields'],"\"")-1); Thanks Andy. |
The string is actually a serialized array. You can "reform" the array using the unserialize() function.
|
Superb, thanks!
Code:
$customfields = unserialize($row_Events['customfields']); Andy |
All times are GMT. The time now is 08:13 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|