2017년 6월 5일 월요일

splite the string with ";" to json and how to translate the json to string wi


in the php & js ,
i can split the string post or get to the url as http://abc.com/index.php?selectlist=1;2;3;4;5;&&userid=55555;
in js i can:

$("#abc' tr").each(function(){ 
$("#'abcstr").val($("#abcstr").val()+";"+$(this).attr("value"));
   });
var url3="'.U('Cosplaymanagerview/get_cosplaylistfilterlevelajax').'";
$.post(url3, {
getwhat:"grouplistne",
cosplayid:$("#editcosplayid").val(), befiltergroupidarray:$("#abcstr").val()},function(Result,status){ arr3 = [];

for(var key in Result) 
{ arr3.push({text:Result[key].groupid+Result[key].groupname,id:Result[key].groupid});
liger.get("abc3").setData(arr3); }); }

in php i can :
$befiltergroupidarray=explode(';',$befiltergroupidarraystr);

i just to ask the question is how to split the string with ";" to json/array   and how to  translate the json/array to string with ";"    in AI2  how to do this? thanks!

--
If you want to build a string 1;2;3;4;5 from an AI2 list L of 5 items 1,2,3,4,5
you would run the list through a csv from list block, then
through a text block that replaces all "," with ";".

Use the text JOIN block to build the URL from the pieces of text, adding more sockets using the blue square.

To pick out the 1;2;3;4;5 from the URL, see https://puravidaapps.com/snippets.php#2parse
parse.aia
and to turn it into a list, reverse the process I described above.


-- 

댓글 없음:

댓글 쓰기