Re: Count how many times a value occurs in an array [message #179270 is a reply to message #179268] |
Thu, 27 September 2012 17:14 |
Ryan
Messages: 15 Registered: July 2012
Karma:
|
Junior Member |
|
|
On Thursday, September 27, 2012 9:19:08 AM UTC-7, M. Strobel wrote:
> Am 27.09.2012 13:08, schrieb Erwin Moller:
>
>> On 9/27/2012 12:48 PM, Captain Paralytic wrote:
>
>>> On Sep 27, 7:25 am, Ryan <rbile...@gmail.com> wrote:
>
>>>>
>
>>>> jw if ph has a build in function to make this easy of am I going to have to roll
>
>>>> my own by looping though the array?
>
>>>
>
>>> Care to explain what the above is supposed to mean?
>
>>>
>
>>
>
>> jw probably means: Just wondering
>
>> ph probably means PHP
>
>>
>
>
>
> I hope (for him) the OP does not program the same way he is writing.
>
>
>
> /Str.
Oh so will arra_count_values not work? lol that's what I get for typing tired. Fortunately for me my IDE will highlight any errors lol.
On a more serious note though I have noticed one limitation. It will no go into sub arrays. So when I query my DB it will actually come up like this
array (array(1), array(1), array (2)) ect. So what would be the best way to deal with this, is there a way to go though and clean it up by removing the nested arrays and replacing them with integers or even a literal string would work for me.
I suppose if all else fails I could just loop though the primary array and implode each sub array.
|
|
|