Managing custom attributes in PHP
-
First, all the best for 2013, KUTGW
I’m using custom attributes for my events. I’m managing a soccer team site and I put the results in a custom attributes in the form ‘2-1’.
No problem for using this in my template but I would like to go further by splitting this string in order to have 2 digits in an array:
ex / 2-1 ==> [2],[1]
I tried this but it doesn’t work :$_score='#_ATT{Score}'; $scores=explode('-',$_score);
It seems that it does not match the ‘-‘ but somethng else.
I tried to decode the strings with some PHP functions but it fails too.
I tried also regexp but same results with this one…
(\d+)\D+(\d+)
Maybe here digits are not matched…Any idea ? thanks
Christian
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Managing custom attributes in PHP’ is closed to new replies.