[UPHPU] easy asort() question

Sheri design5279 at gmail.com
Wed Jun 22 10:19:13 MDT 2005


On 6/22/05, David Boucha <boucha at gmail.com> wrote:
> 
> >
> >
> > I don't think the output is wrong, I think it is how you are assigning
> > the array that is wrong. Do the print statements like Mac suggested
> > and see what your array looks like.
> >
> 
> I agree.
> 
> $gradestudent[] = $math[$index].$student[$index];
> 
> This is your problem. You are just adding a value, so PHP is adding in
> default keys for you. I bet your array looks something like this:
> 
> 0 => albert einstein - Grade B
> 1 => isaac newton - Grade B
> 2 => simon bolivar - Grade B
> 3 => ivan the terrible - Grade C
> 4 => napoleon - Grade C


Right, but I think the array is actually like this: 

0 => Grade Balbert einstein
1 => Grade Bisaac newton
2 => Grade Bsimon bolivar
3 => Grade Civan the terrible
4 => Grade Cnapoleon



More information about the UPHPU mailing list