Newsgroups: php.internals,php.qa Path: news.php.net Xref: news.php.net php.internals:63249 php.qa:66726 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66956 invoked from network); 30 Sep 2012 12:03:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Sep 2012 12:03:22 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:63031] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/E6-13052-80538605 for ; Sun, 30 Sep 2012 08:03:21 -0400 Received: by lbbgm13 with SMTP id gm13so1117013lbb.29 for ; Sun, 30 Sep 2012 05:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=UcSxsvdQJglvQWdKZZBT82cI33wq+ocaRVazjpiPmgc=; b=IDAHTnHBxnobMRrv+SxC1439RehpK9iX7kvxuVyn0ERUMAU9X+PYQTtHHyqmZ1o0Xo YgsSOWAcv1C8Dc80jLA+8q5pKsSeYCz3XE2aiGLlgzjZ+A+e6spnqgS2/+KbGHiU4b/o jSE7YUppI4D/J8VeZiX1mLPKjdifvMIyGKIruxsqvorXxnv+mUuNmNPldYCvDocWQIFH jPilTomLeVdc+UKf+D1+nnD14WFR+I1HQN3CKxtuvsZikChwguT25yhbkiIUIVDSNpZR fLipNZPjdbdz7m8AWVjxLqe1Qhs2hOmgXHHe9ydoavMwbteSy82/P6vGVwX7bjWLUT8z u5xg== MIME-Version: 1.0 Received: by 10.152.106.81 with SMTP id gs17mr9756795lab.2.1349006596890; Sun, 30 Sep 2012 05:03:16 -0700 (PDT) Received: by 10.114.22.1 with HTTP; Sun, 30 Sep 2012 05:03:16 -0700 (PDT) In-Reply-To: <781C00C3309B4CAFB5E4B612E94A46C1@charliesomerville.com> References: <781C00C3309B4CAFB5E4B612E94A46C1@charliesomerville.com> Date: Sun, 30 Sep 2012 08:03:16 -0400 Message-ID: To: Charlie Somerville Cc: kuldeep dhaka , Ferenc Kovacs , php-qa@lists.php.net, PHP Internals Content-Type: multipart/alternative; boundary=f46d0408d58301df6f04caea13ab Subject: Re: [PHP-DEV] Funny array function From: ircmaxell@gmail.com (Anthony Ferrara) --f46d0408d58301df6f04caea13ab Content-Type: text/plain; charset=ISO-8859-1 Yes, it's fairly trivial to write a function for this. I wrote a pair of them in about 2 minutes: http://codepad.viper-7.com/rqVlqL On Sun, Sep 30, 2012 at 7:56 AM, Charlie Somerville < charlie@charliesomerville.com> wrote: > I'm struggling to imagine how such a function would be useful considering > you can already use [] to index arrays. > > If you have a variable 'depth' you need to drill down to, then writing a > function to do that is also fairly trivial. > > > On Sunday, 30 September 2012 at 9:50 PM, kuldeep dhaka wrote: > > > hello guys, > > this is my first time, if thing mail is at wrong place please forward it > > the right place. > > while coding , i just found a requirement, its little bit funny. if it > > already exists, please be calm and mail me the function name and its > usage. > > > > for accessing arrays we use > > > echo $array["school"]["class"]["roll_number"]["name"]; // this will print > > the name of the student > > /* > > i was thinking if is their any function that can do the above work like > > */ > > echo array_drill($array, array("school","class","roll_number","name")); > > > > // like wise while assigning values > > array_drill(, , ); > > ?> > > i hope you guys would have understood what i mean. > > kuldeep singh dhaka > > kuldeepdhaka9@gmail.com (mailto:kuldeepdhaka9@gmail.com) > > > > > > > --f46d0408d58301df6f04caea13ab--