| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Splitting a string into an array | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Splitting a string into an array
Hi
How do I split a string into an array from within a smarty template.
__________________
4.5.2 gold |
|||||||
#2
|
|||||||
|
|||||||
From:
http://smarty.incutio.com/?page=SmartyTips If you need to create an array from a string inside template use something like this: Code:
Comma "," can be replaced with any separator. Result is the same as in php: Code:
|
|||||||
#3
|
|||||||
|
|||||||
Thanks Chris,
I am a bit new at smarty and I am not quite sure what it means and what variables go where. What are optionA, optionB, optionC and where does the string I want to splt go. Please could you explain what they mean. Andrew
__________________
4.5.2 gold |
|||||||
#4
|
|||||||
|
|||||||
I would suggest the PHP docs on "split".
http://us3.php.net/split Basically, split is used to create an array from a string that is seperated by a delimiter. Here is an example: Let's say you have a string: Code:
You can use the function to split this string into an array. Code:
Now, you can use this array. Code:
This should print out: Code:
|
|||||||
#5
|
|||||||
|
|||||||
Chris,
Thanks for your help - it worked just fine. I have been now been able to get the AVS result for credit payments included at the end of the subject line in the admin order confirmation email. It is a quick way of checking possible fraud. Regards Andrew
__________________
4.5.2 gold |
|||||||
|
|||
X-Cart forums © 2001-2020
|