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 #183088 is a reply to message #183084] Mon, 07 October 2013 16:56 Go to previous messageGo to previous message
Mr Oldies is currently offline  Mr Oldies
Messages: 241
Registered: October 2013
Karma:
Senior Member
On Mon, 07 Oct 2013 09:20:47 -0700, Daniel Pitts wrote:

> 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.

True, I could do it that way.
But I am using the keys mainly as a guide for me.

I have a complete database online.
But for this purpose, it's easier to use an array.
[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: Sat Nov 23 19:34:49 GMT 2024

Total time taken to generate the page: 0.05637 seconds