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

Home » Imported messages » comp.lang.php » Yet another error for some unknown reason
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Yet another error for some unknown reason [message #183086 is a reply to message #183083] Mon, 07 October 2013 16:43 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Mon, 07 Oct 2013 12:10:52 -0400, richard wrote:

> <?php

This is the problem. You haven't actually written php, you only claim to
have written php, and the interpreter isn't being fooled by the claim.

Why you're pissing about setting sequential associative indexes on the
array elements I have no idea, but I'm sure it makes sense on
planetRichard.

Likewise, I'm sure there is a very good reason indeed for storing
integers as strings.

If you want to generate your playlist in a random order (which is where I
suspect this is going) then I would use the following:

(a) Set the array up as follows:

$playme = array(
array(1960,1,"title","artist","file"),
array(1960,1,"title","artist","file"),
array(1960,1,"title","artist","file")
);

_^_ By the way, this semi-colon is *NOT* *OPTIONAL*

then:

shuffle($playme);

foreach($playme as $a)
echo "{$a[2]} by {$a[3]}, number {$a[1]} in {$a[0]}, {$a[4]}\n";

Here's an amazing fact about PHP:

The elements of an array do not have to all be of the same type!

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: A general note on invalid.com and others like it
Next Topic: How to link properly?
Goto Forum:
  

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

Current Time: Wed Nov 27 15:10:07 GMT 2024

Total time taken to generate the page: 0.07029 seconds