How to split a string with Smarty [SOLVED]
Posted: Sun Jul 05, 2009 10:14 pm
Sorry for posting something not specifically CMSMS-related, but I have searched high and low in the Smarty manual as well as elsewhere online, and can't find an answer. As the post title says, I'm looking for a way to split a string with Smarty. I have a string "abc,def,ghi,jkl", and I want to split it at the commas, into an array.
I'm sure this is possible, so I must be searching using the wrong keywords.
I'm thinking it's probably something like
$var = abc,def,ghi,jkl
myArray = split{",", $var}
myArray[0] = 1
etc
Any help? Thanks a lot!!
I'm sure this is possible, so I must be searching using the wrong keywords.
I'm thinking it's probably something like
$var = abc,def,ghi,jkl
myArray = split{",", $var}
myArray[0] = 1
etc
Any help? Thanks a lot!!