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 #183084 is a reply to message #183083] Mon, 07 October 2013 16:20 Go to previous messageGo to previous message
Daniel Pitts is currently offline  Daniel Pitts
Messages: 68
Registered: May 2012
Karma:
Member
On 10/7/13 9:10 AM, richard wrote:
> <?php
>
> $playme=array(
[snip]
> 38=>array("1961","18","Where The Boys Are","Connie Francis","6118.mp3"),
> 39=>array("1961","19","Hit The Road Jack","Ray Charles","6119.mp3"),
> 40=>array("1961","20","Sad Movies (Make Me Cry)","Sue Thompson","6120.mp3")
>
> )
Missing ; here.
>
>
>
> $numbers = range(1, 40); <<<- parse error here?
> shuffle($numbers);
> foreach ($numbers as $number) {
> echo "$number \n";
> }
> ?>
>
>
> It worked fine with keys 1 through 20.
> It failed when I added keys 21 through 40.
>

BTW, you can clean this up a bit, by not using [number]=>value,

$playme = array(
array("1960","1","A Summer Place","Percy Faith Orch","6001.mp3"),
array("1960","2","He'll Have To Go","Jim Reeves","6002.mp3"),
etc...
);

Also I would suggest considering externalizing this data. Put it in a
file and load that file. A CSV seems like a good choice. If you're
going to have a lot more data, then a database would be a better choice.
[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: Thu Nov 28 13:52:04 GMT 2024

Total time taken to generate the page: 0.04004 seconds