FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » array search part 2
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: solved [message #183786 is a reply to message #183785] Tue, 19 November 2013 14:16 Go to previous messageGo to previous message
Scott Johnson is currently offline  Scott Johnson
Messages: 196
Registered: January 2012
Karma:
Senior Member
On 11/19/2013 5:50 AM, Ben Bacarisse wrote:
> richard <noreply(at)example(dot)com> writes:
<snip>
>> {if ($six0[$item][2]=$six0[$track][2])
<snip>
>> {$match=$item;}}
>> }
>>
>> http://mroldies.net/list/decade60.html
>>
>> The for loop searches through the array for a match first based on name.
>> Then further matches by label number.
>> [0]=charted name
>> [1]=flipside
>> [2]=label
>
> You can make the code more self-documenting by using defined constants
> for these indexes:
>
> define('FLIPSIDE', 1);
> define('LABEL', 2);
> ...
> if ($six0[$item][LABEL]) ...
>
> or by using string indexes directly (e.g. if ($six0[$item]['label']) ...).
>

Hello Ben.

Most around here are still trying to get Richard to understand and
implement the difference between 'assignment' and 'comparison'.

Now you are bringing in another level of discipline.

The next thing you will be asking is for him to proof read his code when
he has errors prior to bringing them here.

But I have to admit it does give me some humorous light reading at times.

Scotty
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: searching an array
Next Topic: Perform maths based on a number in a text file
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 03:53:29 GMT 2024

Total time taken to generate the page: 0.04329 seconds