Path: csiph.com!fu-berlin.de!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Date: Thu, 14 Jan 2016 09:20:44 +0100 From: Anders Wegge Keller Newsgroups: comp.lang.php Subject: Re: parsing print_r() output with preg_match_all() Message-ID: <20160114092044.04ce166e@geostat.dk> References: <568d3dcf$0$23748$e4fe514c@news.xs4all.nl> <87r3huzevd.fsf@bsb.me.uk> <568d6f9c$0$23759$e4fe514c@news.xs4all.nl> <569363A3.6040108@arnowelzel.de> <5694313D.3060100@arnowelzel.de> <6929015.zlp62RpN2j@PointedEars.de> <569483AF.6010606@arnowelzel.de> <56956576.3040909@arnowelzel.de> <56956FF5.3050603@arnowelzel.de> <5695E316.9050809@arnowelzel.de> <56974F6B.1040705@arnowelzel.de> Organization: Disorganized X-Newsreader: Claws Mail 3.13.1 (GTK+ 2.24.29; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Lines: 38 NNTP-Posting-Host: 2.110.225.100 X-Trace: news.sunsite.dk DXC=l]_moNF92BFSi^`20K04QCYSB=nbEKnkKI\QCV9\IQFL=anD=lJfodB7=oO3E@N7`CY2U4N[3JdNB2;6_KCe=UM@d< wrote: > If one does not have any experience with XML, even this may not be clear > to him: > > > > > > > > > > > > And is the key always a string or will numbers be treated different? In > JSON it is possible to differentiate the data type as well, if needed: > > { > "a": "apple", > "b": "banana", > "c": [ > 1, > 2, > 3 > ] > } > > Didn't OP state "Human readable" as a requirement? The S/N ratio is much better with JSON. For this simple structure, it is manageable, but when you get a multi-megabyt XML file, it is time to bring out the special tools. -- //Wegge