View Single Post
  #4  
Old 11-14-2005, 07:12 AM
 
cbarnes cbarnes is offline
 

Member
  
Join Date: Oct 2005
Location: Kansas
Posts: 18
 

Default

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:
blue,red,yellow,orange,green,purple

You can use the function to split this string into an array.

Code:
{assign var="color" value=","|split:"blue,red,yellow,orange,green,purple"}

Now, you can use this array.

Code:
{section name=mysec loop=$color} {$color[mysec]} {/section}

This should print out:

Code:
blue red yellow orange green purple
__________________
Chris Barnes
Ative LLC
X-Cart Development & Consulting
Reply With Quote