lua中使用json

Debug posted @ 2013年3月21日 13:55 in 代码片段 with tags json Lua , 14496 阅读

用lua的cjson包就行了。

下载地址在这里 http://www.kyne.com.au/~mark/software/lua-cjson.php

安装的话,make&make install就行了。

local cjson = require("cjson")

local str = '["a", "b", "c"]'
local j = cjson.decode(str)
for i,v in ipairs(j) do
    print(v)
end

str = '{"A":1, "B":2}'
j = cjson.decode(str)
for k,v in pairs(j) do
    print(k..":"..v)
end
j['C']='c'
new_str = cjson.encode(j)
print(new_str)
Jai Munro 说:
2018年11月29日 11:37

The reflection of the material is done for the humans. The essence of the terms and bestbritishwriter.com we secured for the struggle and all moved items for the humans. The overall items of the project have been designed for the humans and all available routes for the people.

shawnkemp 说:
2018年12月24日 16:18

Appreciated! I am most likely to share this article because it has guided me the best package to take the tour of these Ravines and join website to manage your task. I like this package because <a href="https://www.topcelebrityjackets.com/burberry-prorsum-black-biker-leather-jacket">Burberry Prorsum Jacket</a> it is very cheap sounds great in terms of revolution.

shawnkemp 说:
2018年12月24日 16:20

Appreciated! I am most likely to share this article because it has guided me the best package to take the tour of these Ravines and join website [url=https://www.topcelebrityjackets.com/burberry-prorsum-black-biker-leather-jacket]Burberry Prorsum Jacket[/url] to manage your task. I like this package because

dfdf 说:
2019年1月28日 18:47

CGC Jhanjeri is one of the best colleges in the North India and we are providing the best quality of education in various courses.
engineering college in chandigarh
best engineering college in punjab
Cgc admission
agriculture College in chandigarh
MBA college in punjab
fashion technology college in mohali

Mark 说:
2019年2月07日 18:09

Our academic pursuits, along with a range of extracurricular activities, help in honing a child's skills and ensuring that he/she grows to be a mature and responsible citizen.
best cbse school in greater noida
premium school in greater noida

MHR Writer UK 说:
2019年3月27日 19:38

Regular visits listed here are the easiest method to appreciate your energy, which is why why I am going to the website everyday, searching for new, interesting info. Many, thank you!

navigate to this web 说:
2019年4月17日 15:21

his means writing Santa Claus letters detailing exactly what they’ve done to deserve their presents — things such as being extra nice to their siblings, helping out with chores and doing their homework.

Balloons 说:
2019年4月20日 17:41

I will be interested in more similar topics. i see you got really very useful topics , i will be always checking your blog thanks

Party Favors 说:
2019年4月22日 14:43

Very nice blog and articles. I am realy very happy to visit your blog. Now I am found which I actually want. I check your blog everyday and try to learn something from your blog. Thank you and waiting for your new post.

Figures 说:
2019年4月22日 17:56

Great Information sharing .. I am very happy to read this article .. thanks for giving us go through info.Fantastic nice. I appreciate this post.

plush 说:
2019年4月22日 21:01

I would recommend my profile is important to me, I invite you to discuss this topic...

Gos 说:
2019年4月23日 19:41

The Health system is created in a proficient way of expanding the network in the multispecialty services. With the ever-growing population, the hospital has announced many ambitious plans that have ultimately lead to the excellence.
maternity Hospital in hisar
best IVF center in hisar
laparoscopy surgery in hisar
And
best play school in hisar

Money saver 说:
2019年4月24日 15:41

Invoice Discounting is actually a method followed to make complete use of company’s due accounts. If done well, this can help business owners to manage their cash flow efficiently.

toddler toys 说:
2019年4月24日 19:27

A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one

Grab and go play pac 说:
2019年4月25日 15:14

Excellent effort to make this blog more wonderful and attractive.

collectible tins 说:
2019年4月25日 18:02

Excellent effort to make this blog more wonderful and attractive.

ver dragon ball 说:
2019年4月25日 20:54

I feel really happy to have seen your webpage and look forward to so many more entertaining times reading here. Thanks once more for all the details.

iPhone Repair in Dub 说:
2019年5月01日 17:14

Hey, great blog, but I don’t understand how to add your site in my rss reader. Can you Help me please?

Tyre Shop Dubai 说:
2019年5月02日 17:06

Soon, pilgrims from all over Christendom were journeying to Myra to seek the gifts of protection and healing from the saint, who was said to be especially attentive to children.

mtom 说:
2019年6月01日 04:39

You made some decent points there. I looked over the internet with the issue and discovered most people goes along with with the web site. thetrever e brochure

 

I don’t normally comment but I gotta tell regards for the post on this one : D. https://www.piermontgrands.com.sg/punggol-ura-master-plan/

Quran academy online 说:
2019年6月18日 15:16

<!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--> We are innovative so we teach online and offer you the best learning practiceQuran academy online

diamond jewelry indi 说:
2019年6月23日 15:07
diamond jewelry india      Hey, great blog, but I don’t understand how to add your site in my rss reader. Can you Help me please?
<!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}-->
jewelry stores katy 说:
2019年6月25日 15:05

<!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--> Send this gift to your children, grandchildren, nieces and nephews and even friends. jewelry stores katy tx

machu picchu peru to 说:
2019年6月25日 18:12

It’s very informative and you are obviously very knowledgeable in this area. You have opened my eyes to varying views on this topic with interesting and solid content.

new listings houses 说:
2019年6月28日 20:11 A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post.
new listings houses for sale mls 
hazrat umar, 说:
2019年6月29日 17:51

<!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--> Hey, great blog, but I don’t understand how to add your site in my rss reader. Can you Help me please?

Ramadan, 说:
2019年6月30日 17:27

<!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--> Send this gift to your children, grandchildren, nieces and nephews and even friends.

gynaikesonly.net 说:
2019年6月30日 23:27

I wish more writers of this sort of substance would take the time you did to explore and compose so well. I am exceptionally awed with your vision and knowledge.

Warmtepomp 说:
2019年7月01日 19:10

Gangaur Realtech is a professionally managed organisation specializing in real estate services where integrated services are provided by professionals to its clients seeking increased value by owning, occupying or investing in real estate.

Airconditioning 说:
2019年7月02日 17:18

I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.

best Instagram Bot 说:
2019年7月03日 11:58 A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post.

 

 

Zonnepanelen kopen 说:
2019年7月03日 20:17

Wow! Such an amazing and helpful post this is. I really really love it. It's so good and so awesome. I am just amazed. I hope that you continue to do your work like this in the future also.

Nifty chart 说:
2019年7月03日 21:04

Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.

lambingan 说:
2019年7月04日 17:24

<!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}-->

Hey, great blog, but I don’t understand how to add your site in my rss reader. Can you Help me please?  

 

pittsburgh injury la 说:
2019年7月06日 18:42

I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.

teleserye 说:
2019年7月07日 19:17

<!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--> Send this gift to your children, grandchildren, nieces and nephews and even friends.

 

https://www.xapiaadi 说:
2019年7月10日 01:33

Glad to chat your blog, I seem to be forward to more reliable articles and I think we all wish to thank so many good articles, blog to share with us.

Arbeitsschein 说:
2019年7月11日 12:32

This kind of message continuously motivating and I like to peruse quality basis, so glad to discover great spot to numerous here in the post, the composing is frankly incredible, a debt of gratitude is in order for the post. 

Arbeitsschein

Airco 说:
2019年7月14日 21:11

I curious more interest in some of them hope you will give more information on this topics in your next articles.

Zonnepanelen 说:
2019年7月15日 18:33

Actually I read it yesterday but I had some thoughts about it and today I wanted to read it again because it is very well written.

Peachtree city Comme 说:
2019年7月17日 18:12

This is such a fabulous resource. Peachtree city Commercial Roof Replacement  I found your website perfect for my needs. I actually like what you have acquired here, really like what you’re saying and the way in which you say it. Thank you for your discuss.

πλαστικοι χειρουργοι 说:
2019年7月20日 21:50

Have you already setup a fan page on Facebook ?;;`:’ <a href='https://www.plasticsurgery4cyprus.com/page/el/10/about-us'>πλαστικοι χειρουργοι κυπρος</a>

Pc Repair Louth 说:
2019年7月20日 21:50

Around my quest on the web, We seen this blog publish, It is rather comprehensive but you ought to acknowledge this kind of remark. I need money too Pc Repair Louth

http://pr-history.lu 说:
2019年7月21日 06:16

Wow, wonderful blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is magnificent, let alone the content! http://pr-history.lukaswojcik.com/edtl.com.pt

 

 

wonderful post, very informative. I wonder why the other specialists of this sector don’t realize this. You should continue your writing. I’m sure, you have a huge readers’ base already! http://grandtheatrepaoecirco.blogspot.com/2011_07_01_archive.html

seo chester 说:
2019年7月22日 12:43

Such a very valuable and interesting article. I really admire your kindness and very educational content and written well for a change.

seo chester

what wordpresss meri 说:
2019年7月22日 15:34

This situation document appears to redeem a good deal of audience. Determine how to market it? The idea provides a amazing completely unique distort onto stuff. Reckon offering anything proper or alternatively great offer information about is central to the subject. what wordpresss merimbula version am i using

apps like zomato 说:
2019年7月22日 23:10

I don’t unremarkably comment but I gotta say thank you for the post on this special one . apps like zomato

 

Wow! This might be one particular of the most useful blogs We’ve appear throughout about this subject matter. Basically Fantastic. I’m also a professional on this topic therefore I can comprehend your effort. pendirian cv

one pearl bank showf 说:
2019年7月24日 18:16

I have caught great sites and I have caught not so wonderful blogs. This blog is very informationrmative in many ways and certainloy ranks in the former category. Really appreciate the information your providing use avid scaners! one pearl bank showflat

 

There a few interesting points in time here but I do not determine if these people center to heart. There may be some validity but I’m going to take hold opinion until I explore it further. Great post , thanks and now we want a lot more! Included with FeedBurner likewise florence residences showflat

$1500 loan from Unit 说:
2019年7月26日 05:05

I’d have to check with you here. Which is not something I usually do! I enjoy reading a post that will make people think. Also, thanks for allowing me to comment! $1500 loan from UnitedFinances.com

commercial cleaning 说:
2019年7月27日 01:09

I think this is an institutional post and it is very beneficial and knowledgeable. I am very happy to read this substance. I think commercial cleaning and janitorial company this is an educational post and it is very useful and knowledgeable. Thank you for your discuss.

Mesin Slot 说:
2019年7月27日 16:33

very good post, i definitely love this excellent website, keep on it Mesin Slot

 

hi good page i will definaely come back and see again. HiBoox Magazine

how to fix a strippe 说:
2019年7月28日 17:31

I appreciate your wordpress template, wherever did you get a hold of it through? how to fix a stripped screw hole

 

 

Excellent beat ! I wish to apprentice while you amend your web site, how can i subscribe for a blog site? The account helped me a acceptable deal. I had been a little bit acquainted of this your broadcast provided bright clear idea marble countertop installation

Stratford landscape 说:
2019年8月01日 02:38

This is a smart blog. You have so much  Stratford landscape knowledge about this issue and so much passion. I found your website perfect for my needs. I truly like what you have acquired here, really like what you’re saying and the way in which you say it. Thanks for sharing.

pname com facebook o 说:
2019年8月01日 18:39

I do not understand exactly how I ran across your blog because I had been researching information on Real Estate inWinter Springs, FL, but anyway, I have thoroughly enjoyed reading it, keep it up! <a href='http://www.digitalsoftw.com/2019/03/16/how-to-fix-pname-com-facebook-orca/'>pname com facebook orca</a>

Buy Instagram Follow 说:
2019年8月04日 04:12

Well done! I thank you your input to this matter. It has been useful. my blog: how to put on a condom Buy Instagram Followers

https://www.itishome 说:
2019年8月05日 23:03 Hey there! I could have sworn I’ve been to this site before but after reading through some of the post I realized it’s new to me. Anyhow, I’m definitely glad I found it and I’ll be bookmarking and checking back frequently! https://www.itishome.in.th/titan-gel/
http://khyatis.weebl 说:
2019年8月07日 05:24

You need to be a part of a contest for starters of the finest blogs on the web. Let me suggest this page! http://khyatis.weebly.com/about-me.html

http://1hd.one/categ 说:
2019年8月08日 12:46

Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. It is very informative and helpful for me. I admire the valuable information you offer in your articles. I want to say thanks to the writer for sharing us.

http://1hd.one/categories.html

wired magazine 说:
2019年8月08日 16:18

I am glad for writing to let you know what a magnificent discovery my friend’s daughter gained reading your site. She even learned many things, most notably what it is like to have a very effective coaching character to make other folks easily know specific impossible subject areas. You undoubtedly surpassed people’s desires. Thanks for offering these good, trustworthy, explanatory and in addition cool tips on that topic to Ethel. wired magazine

earn to die 说:
2019年8月09日 12:39

Ohh, great! I think your opinion is correct, thank you, I will follow you regularly!

broken leg scooter 说:
2019年8月09日 21:43

Really impressive post. I read it whole and going to share it with my social circules. I enjoyed your article and planning to rewrite it on my own blog.

resorts in sigatoka 说:
2019年8月10日 01:05

I like the efforts you have put in this, thanks for all the great posts . resorts in sigatoka fiji islands

 

Are you are a recruiter? Now, Transformify HR Software offers a 7-day free trial. Save 60% on hiring costs, post unlimited job listings and source top candidates. human resources

lautoka fiji beaches 说:
2019年8月10日 04:44

Awesome! I appreciate your contribution to this matter. It has been useful. my blog: cityville cheats lautoka fiji beaches

 

This is a lot better than the Sociable plugin I use on WordPress. Much better! port vila hotels resorts

dcb 说:
2019年8月14日 15:31

Welcome to the world of gaming, where life is fast paced and interesting. There is always an adventure waiting for you online.
csgo accounts

here 说:
2019年8月15日 02:04

An fascinating discussion may be worth comment. I think that you ought to write regarding this topic, may possibly not be described as a taboo subject but normally folks are inadequate to speak on such topics. To a higher. Cheers here

 

appreciation for blogging!. “Shoot for the moon. Even if you miss, you’ll land among the stars.” by Les Brown.. mp3goo


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter