Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #13504
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail |
|---|---|
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Newsgroups | comp.lang.php |
| Subject | Re: how to join two arrays? |
| Date | Sun, 04 May 2014 21:47:08 +0200 |
| Organization | PointedEars Software (PES) |
| Lines | 54 |
| Message-ID | <4250025.snfbUPKjyN@PointedEars.de> (permalink) |
| References | <1ma4780alja8r$.a7gtdehqwehf$.dlg@40tude.net> <lk3q91$aom$4@dont-email.me> <7972885.Ly6agpYKli@PointedEars.de> <lk63ol$44c$1@dont-email.me> |
| Reply-To | Thomas 'PointedEars' Lahn <php@PointedEars.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset="ISO-8859-1" |
| Content-Transfer-Encoding | 7Bit |
| X-Trace | solani.org 1399232843 17594 eJwFwQkBwDAIA0BL0IVnciAF/xJ6Z5+rM+DmsLU9xNDvlHUu4zYoW/N3rJ++QiGAVc3RyrAHRikSGw== (4 May 2014 19:47:23 GMT) |
| X-Complaints-To | abuse@news.solani.org |
| NNTP-Posting-Date | Sun, 4 May 2014 19:47:23 +0000 (UTC) |
| User-Agent | KNode/4.12.4 |
| X-User-ID | eJwFwQkBACAIBLBKfIcQBxT6R3CDOvs95nDDYlMmiprFTR5RHgytsSZPJDqqMCh7dndXuYMeLUdXkvqR+T0FFSs= |
| Face | iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/Tmp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Uc= |
| Xref | csiph.com comp.lang.php:13504 |
Show key headers only | View raw
Jerry Stuckle wrote:
> On 5/4/2014 1:56 PM, Thomas 'PointedEars' Lahn wrote:
>> Denis McMahon wrote:
>>> then: array_merge ( $arr1, $arr2 );
>>>
>>> will generate:
>>>
>>> [0] "."
>>> [1] ".."
>>> [2] "foo.bar"
>>> [3] "really fubar"
>>> [4] "."
>>> [5] ".."
>>> [6] "bah bah.blacksheep"
>>> [7] "fufu.fubar"
>>>
>>> How you then tell which file is where, that's your headache at this
>>> point.
>>
>> array_map() serves here.
>
> And how can array_map() tell which file is where?
It cannot. However, if you apply array_map() to the arrays returned by
scandir() before merging them, the problem at hand does not occur in the
first place:
$modi = max(
array_map('filemtime',
array_diff(
array_merge(
scandir(__DIR__),
array_map(
function ($e) {
return 'sections' . DIRECTORY_SEPARATOR . $e;
},
scandir('sections')
)
),
array('.', '..')
)
)
);
HTH
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
how to join two arrays? richard <noreply@example.com> - 2014-05-03 13:25 -0400
Re: how to join two arrays? "J.O. Aho" <user@example.net> - 2014-05-03 22:07 +0200
Re: how to join two arrays? Denis McMahon <denismfmcmahon@gmail.com> - 2014-05-03 22:23 +0000
Re: how to join two arrays? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-04 19:56 +0200
Re: how to join two arrays? Jerry Stuckle <jstucklex@attglobal.net> - 2014-05-04 15:17 -0400
Re: how to join two arrays? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-04 21:47 +0200
Re: how to join two arrays? Jerry Stuckle <jstucklex@attglobal.net> - 2014-05-04 16:48 -0400
Re: how to join two arrays? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-04 23:02 +0200
Re: how to join two arrays? Jerry Stuckle <jstucklex@attglobal.net> - 2014-05-04 17:51 -0400
Re: how to join two arrays? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-05 00:55 +0200
Re: how to join two arrays? Jerry Stuckle <jstucklex@attglobal.net> - 2014-05-04 21:31 -0400
Re: how to join two arrays? Jerry Stuckle <jstucklex@attglobal.net> - 2014-05-04 22:13 -0400
Re: how to join two arrays? Richard Yates <richard@yatesguitar.com> - 2014-05-05 12:45 -0700
solved (was: how to join two arrays?) richard <noreply@example.com> - 2014-05-04 19:54 -0400
Re: solved richard <noreply@example.com> - 2014-05-04 22:00 -0400
Re: solved Jerry Stuckle <jstucklex@attglobal.net> - 2014-05-04 22:27 -0400
Re: solved richard <noreply@example.com> - 2014-05-04 23:07 -0400
Re: solved Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-05-05 11:11 +0100
Re: solved richard <noreply@example.com> - 2014-05-05 09:42 -0400
Re: solved Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-05 15:51 +0200
Re: solved Jerry Stuckle <jstucklex@attglobal.net> - 2014-05-05 10:26 -0400
Re: solved richard <noreply@example.com> - 2014-05-05 10:34 -0400
Re: solved Doug Miller <doug_at_milmac_dot_com@example.com> - 2014-05-06 00:55 +0000
Re: solved Denis McMahon <denismfmcmahon@gmail.com> - 2014-05-05 13:36 +0000
csiph-web