Basket #52503 (Version: ) - Miva - Snippets
<mvt:assign name="g.string" value="'asdfasdf'" /> <h3>Split String mvt:do</h3> <p>Does not inherently support multi-character splitting, you'd have to perform a glosub first (see next example)</p> <mvt:do file="g.Module_Library_Utilities" name="l.success" value="SplitString( g.string, '|', g.splitString )" /> <!-- @@ &mvt:global:MvDO_Error; --> <mvt:assign name="g.relprod_arr_len" value="miva_array_elements(g.splitString )" /> Cookie recentproductd array length: &mvt:global:relprod_arr_len; <br> <mvt:foreach iterator="line" array="global:splitString"> &mvt:line;</br> </mvt:foreach> <br> <h3>Deserialize+Global Substitution</h3> <p>This method supports multi-character splitting, as you're just replacing your seperator with a single comma</p> <mvt:assign name="g.array" value="miva_array_deserialize( glosub(g.string,'|',',') )" /> <mvt:foreach iterator="line" array="global:array"> &mvt:line;</br> </mvt:foreach>