Newsgroups: php.internals,php.qa Path: news.php.net Xref: news.php.net php.internals:63248 php.qa:66725 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65229 invoked from network); 30 Sep 2012 11:56:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Sep 2012 11:56:22 -0000 Authentication-Results: pb1.pair.com header.from=charlie@charliesomerville.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=charlie@charliesomerville.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain charliesomerville.com designates 209.85.220.42 as permitted sender) X-PHP-List-Original-Sender: charlie@charliesomerville.com X-Host-Fingerprint: 209.85.220.42 mail-pa0-f42.google.com Received: from [209.85.220.42] ([209.85.220.42:43288] helo=mail-pa0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 87/86-13052-46338605 for ; Sun, 30 Sep 2012 07:56:21 -0400 Received: by padfa1 with SMTP id fa1so3616579pad.29 for ; Sun, 30 Sep 2012 04:56:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:message-id:in-reply-to:references:subject:x-mailer :mime-version:content-type:x-gm-message-state; bh=jrj25F3a0POIIUJK0oEnSiaf7ORG+NnWcrfxNVCK+cc=; b=fKkNx7q1/QssU6L0kz9uWPWyTO2bsReFZiyVgWNniTxNJhuXbl4xCEnomzYcmkxM3l Wfttky9O/1f53GTc+luyHJiNaslhhAoLahg45dqd+vEqxyM/xJD1/QC5wIKePIJ/Zd62 OYFI57Di0sQdweYFZ7zD9rkCbfX+qDKoRIaH5Zu3bjIo1InJ0J9HyUuqyaX3E8dustPZ t9XbVjkNNcjv+CfBda/c3g1S6V0gkFgWVIkhWoTLrV8+VbQIhghLxNga7lAed4DpGpHL jGCiZeQ6tJWQF6zPNtFz/Wd29/pt0pkc1LeorzrDKRiZ+k5+GwsBNW0IqL+UTyGQhu6L 1geQ== Received: by 10.68.204.66 with SMTP id kw2mr33495175pbc.110.1349006177950; Sun, 30 Sep 2012 04:56:17 -0700 (PDT) Received: from [10.1.1.20] (124-148-190-251.dyn.iinet.net.au. [124.148.190.251]) by mx.google.com with ESMTPS id oq7sm2658496pbc.69.2012.09.30.04.56.14 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 30 Sep 2012 04:56:17 -0700 (PDT) Date: Sun, 30 Sep 2012 21:56:11 +1000 To: kuldeep dhaka Cc: Ferenc Kovacs , php-qa@lists.php.net, PHP Internals Message-ID: <781C00C3309B4CAFB5E4B612E94A46C1@charliesomerville.com> In-Reply-To: References: X-Mailer: sparrow 1.6.3 (build 1172) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="5068335b_5bd062c2_c11" X-Gm-Message-State: ALoCoQkm/TjyN+ObnmD4EwT/puEPdKw3uX9FR61W4yU4Qa7wtso7995Rgxb6ZV4LhtMkbM3orWrz Subject: Re: [PHP-DEV] Funny array function From: charlie@charliesomerville.com (Charlie Somerville) --5068335b_5bd062c2_c11 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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) > > --5068335b_5bd062c2_c11--