AndyCooper
01-06-2009, 08:17 AM
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.
a:2:{i:1;s:19:"Birmingham, England";i:2;s:5:"88248";}
There has to be an easier way extracting the two items in quotes in the above string as two different variables instead of using something like:
$location = substr($row_Events['customfields'], strpos($row_Events['customfields'],"\"")+1, strpos($row_Events['customfields'],"\"", strpos($row_Events['customfields'],"\"")+1)-strpos($row_Events['customfields'],"\"")-1);
I'm open to any suggestions.
Thanks
Andy.
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.
a:2:{i:1;s:19:"Birmingham, England";i:2;s:5:"88248";}
There has to be an easier way extracting the two items in quotes in the above string as two different variables instead of using something like:
$location = substr($row_Events['customfields'], strpos($row_Events['customfields'],"\"")+1, strpos($row_Events['customfields'],"\"", strpos($row_Events['customfields'],"\"")+1)-strpos($row_Events['customfields'],"\"")-1);
I'm open to any suggestions.
Thanks
Andy.