Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #11748
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: detection of 2d array? |
| Date | 2013-11-06 17:04 -0500 |
| Organization | A noiseless patient Spider |
| Message-ID | <l5eed4$uo0$2@dont-email.me> (permalink) |
| References | <7x8n4ftkdpt.13nclqr4ren29.dlg@40tude.net> <9d10d1be-f909-4a4d-989d-68ce4ecdbc4b@googlegroups.com> |
On 11/6/2013 8:24 AM, Struchkov Vladimir wrote:
> I write short test for 2d dimension
>
>
> $a=array(1,2,3,4=>array(3,4,5,7=>array(1)));
> if (preg_match('/;a:[0-9]+:{/',serialize($a)))
> {
> echo 'I have more than one dimensions';
> }
> else
> {
> echo 'I have one demension';
> }
>
He was asking if a certain element of the first array is an array or
not; that's what is_array() is for.
J.O. has the best answer.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread
detection of 2d array? richard <noreply@example.com> - 2013-10-24 17:39 -0400
Re: detection of 2d array? "J.O. Aho" <user@example.net> - 2013-10-25 00:10 +0200
Re: detection of 2d array? richard <noreply@example.com> - 2013-10-24 18:12 -0400
Re: detection of 2d array? Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-25 14:58 +0000
Re: detection of 2d array? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-10-26 02:37 +0200
Re: detection of 2d array? Struchkov Vladimir <struchkov@gmail.com> - 2013-11-06 05:24 -0800
Re: detection of 2d array? Jerry Stuckle <jstucklex@attglobal.net> - 2013-11-06 17:04 -0500
csiph-web