Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #11309
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: Yet another error for some unknown reason |
| Date | 2013-10-07 16:43 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <l2uobs$bp8$3@dont-email.me> (permalink) |
| References | <ar44fcpqvv23.4dvziqbqzlxp.dlg@40tude.net> |
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@gmail.com
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Yet another error for some unknown reason richard <noreply@example.com> - 2013-10-07 12:10 -0400
Re: Yet another error for some unknown reason Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-10-07 09:20 -0700
Re: Yet another error for some unknown reason richard <noreply@example.com> - 2013-10-07 12:56 -0400
Re: Yet another error for some unknown reason "Beauregard T. Shagnasty" <a.nony.mous@example.invalid> - 2013-10-07 16:23 +0000
Re: Yet another error for some unknown reason Dennis <nobody@nowhere.invalid> - 2013-10-07 13:07 -0400
Re: Yet another error for some unknown reason Denis McMahon <denismfmcmahon@gmail.com> - 2013-10-07 16:43 +0000
Re: Yet another error for some unknown reason Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-10-07 19:37 +0200
Re: Yet another error for some unknown reason richard <noreply@example.com> - 2013-10-07 12:48 -0400
Re: Yet another error for some unknown reason "J.O. Aho" <user@example.net> - 2013-10-07 20:06 +0200
csiph-web