Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51156 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20599 invoked from network); 31 Dec 2010 14:20:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Dec 2010 14:20:14 -0000 Authentication-Results: pb1.pair.com header.from=markskilbeck@googlemail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=markskilbeck@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 74.125.82.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: markskilbeck@googlemail.com X-Host-Fingerprint: 74.125.82.170 mail-wy0-f170.google.com Received: from [74.125.82.170] ([74.125.82.170:54131] helo=mail-wy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3C/93-01063-D96ED1D4 for ; Fri, 31 Dec 2010 09:20:13 -0500 Received: by wyb39 with SMTP id 39so11667042wyb.29 for ; Fri, 31 Dec 2010 06:20:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=NlNU/hEkh+uQUFrkTgUvuaneCtA8CF5r9f3drDl9mHU=; b=Tkof6uaiMFaWwv7hvaoR7vZ44+1ine+C49nohkSBCA6V3Hu4zUldHfVQrtncLd9xXO KdN1Fk/K5SxDURpJHVeBy0zF5W7bG+YP8ieN2cPKhu8ts0pV5mYSSZvwiQ9O0Kw7eH0K 98+uX3y32G2IkTWbHRaoQOnH1jNXoNWla35XY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=oSgAEeT8mS26Am1gnqCR7WtJxkC6TCOpZmYqYjqdah8SAcPIOZivnCxYyMFFST3ohH 8zfMHX+c4wREZfnpZIHLgLcXHbKLMRSG6Gdpxp+LsaGfT1yIux5OwIE7W8B2X2wNG3uu v4G/GDzMJTxiRRTfjWP7owhm5VQejl7o4882I= MIME-Version: 1.0 Received: by 10.227.144.12 with SMTP id x12mr10056037wbu.102.1293805208647; Fri, 31 Dec 2010 06:20:08 -0800 (PST) Received: by 10.227.159.205 with HTTP; Fri, 31 Dec 2010 06:20:08 -0800 (PST) In-Reply-To: References: Date: Fri, 31 Dec 2010 14:20:08 +0000 Message-ID: To: RQuadling@googlemail.com Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Working with arrays. From: markskilbeck@googlemail.com (mark skilbeck) I did it like so: bitbucket.org/winapiforphp/system/src/93583820bbc1/winsystem_registry.c#cl-298 It's a little messy. On Fri, Dec 31, 2010 at 1:48 PM, Richard Quadling wrote: > > Hi. > > What macros exist regarding processing arrays in PHP (core not userland)? > > I want to pass ... > > array('value1', 'value2', 'value3') > > to a function and in the function have it converted to > > 'value1\0value2\0value3\0\0'. > > Conventionally, I'd need to iterate the array to get the lengths of > all the elements, add the number of elements to this value and then 1 > more for the trailing \0. > > Unless there are some macros to allow to do this sort of thing more easily. > > Regards, > > Richard Quadling. > > -- > Richard Quadling > Twitter : EE : Zend > @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Mark Skilbeck. http://blog.mahcuz.com - webmaster http://bytes.com - PHP Forum Moderator