Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #13513
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: solved |
| Date | 2014-05-04 22:27 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <lk6sti$pff$1@dont-email.me> (permalink) |
| References | <1ma4780alja8r$.a7gtdehqwehf$.dlg@40tude.net> <16xq2nliyxm0r.1pydq2jo6js8c$.dlg@40tude.net> <5oo9jupriqe6$.zu9bt3msqine.dlg@40tude.net> |
On 5/4/2014 10:00 PM, richard wrote:
> On Sun, 4 May 2014 19:54:32 -0400, richard wrote:
>
>> On Sat, 3 May 2014 13:25:10 -0400, richard wrote:
>>
>>> I am building an array by scannning ten directories.
>>> With each scanned directory, the output is stored in one array.
>>> How do I properly join that array with a second array?
>>>
>>> Without duplicate keys!
>>>
>>> Array_merge works fine but keys are duplicated.
>>
>>
>> $lo=0;
>> $hi=0;
>>
>> for ($i = 59; $i <= 69; $i++) {
>> $yr="19$i";
>> echo $i;
>> echo $yr;
>> echo "<br>";
>>
>> $dir='../audio/'.$yr.'/';
>> $files = scandir($dir);
>> $number=count($files);
>> echo $number;
>> echo "<br>";
>> sort($files);
>> $hi=$hi+$number;
>> echo $hi;
>> echo "<br>";
>>
>> for ($x=0;$x<=$number;$x++){echo $files[$x];
>> $master[$lo]=$files[$x];
>> $lo=$lo+1;
>>
>> }
>> $lo=$hi;
>> }
>>
>> for ($x=0;$x<=$hi;$x++){echo $master[$x]."<br>";}
>>
>> the echos are there primarily to show what the progress is.
>> they will be removed for final output.
>
> Questio I have now is, how do I get it so the leading "." and ".." are not
> in the final array?
> I tried using a conditional with !="." and that did not work.
>
Richard,
If written correctly a conditional for !="." would get rid of the '.'
entry; !=".." would get rid of the ".." entry.
But you didn't show your entire code, so it's hard to say what could be
wrong.
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
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