Simone
04/27/2023, 9:30 PM<cfset session.data.id = '212|a,b|people,looking'>
<cfloop collection="#session.data#" item="i">
<span>#getToken(session.data[i],2,'|')#</span>
<span> #getToken(session.data[i],3,'|')#</span></div>
</cfloop>
i want to display a = people
b= looking,
i am missing something hereTomy Saman
04/27/2023, 11:06 PMa,b people,looking
assuming your data pattern is:
#id#|#list_of_vars#|#list_of_words#
such as:
212|a,b,c,d,...|people,looking,at,you,...
you can just loop through the 2nd token and outputting each item in the 2nd token & 3rd token (also assume they are the same length):
<cfset session.data.id = '212|a,b,c,d|people,looking,at,you'>
<cfset firstDataSet = listGetAt(session.data.id, 2, "|")>
<cfset secondDataSet = listGetAt(session.data.id, 3, "|")>
<cfloop from="1" to="#listLen(firstDataSet)#" index="n">
#listGetAt(firstDataSet,n)# = #listGetAt(secondDataSet,n)#
<br>
</cfloop>
see:
https://trycf.com/gist/8dbb4e8759accc7db5dcae11e114c33c/lucee5?theme=monokai