-2

次の配列を取得しました

Array (
    [G_ID] => 11
    [Username] => student
    [Password] => admin
    [gender] => m
    [email] => dsfsdas
    [phone] => hgjhg
    [address] => surat
    [birthdate] => 
    [interest] => 
    [goal] => 
    [User_Type] => student
    [Conform] => 1
    [l_name] => student
    [f_name] => student
    [clg_name] => scatt
    [branch] => cseq
    [avatar] => 11avatarJaguar_Logo.jpg
    [Student_Master_ID] => 11
    [Staff_Master_ID_Staff_Master] => 
    [Branch] => cseq
    [Semester] => 8
    [PEN] => 090490131013
    [SPI_1] => 6.50
    [SPI_2] => 5.20
    [SPI_3] => 7.5
    [SPI_4] => 6.5
    [SPI_5] => 8.0
    [SPI_6] => 7.1
    [SPI_7] => 8.0
    [SPI_8] => 0
    [0] => 6.50
    [max(SPI_1)] => 6.50
    [1] => 8.0
    [max(SPI_2)] => 8.0
    [2] => 7.5
    [max(SPI_3)] => 7.5
    [3] => 6.5
    [max(SPI_4)] => 6.5
    [4] => 8.0
    [max(SPI_5)] => 8.0
    [5] => 7.1
    [max(SPI_6)] => 7.1
    [6] => 8.0
    [max(SPI_7)] => 8.0
    [7] => 0
    [max(SPI_8)] => 0
) 

max(SPI_1)この値を印刷したい。この値を印刷するにはどうすればよいですか?

4

2 に答える 2

4

arraysを読んでください。

//    key     => value
// max(SPI_1) => 6.50

その知識があれば、次のようにするだけです。

echo $student["max(SPI_1)"];
于 2013-01-16T20:29:22.483 に答える
1

配列が次のように格納されていると仮定します$array

echo $array['max(SPI_1)'];

これはうまくいきませんか?

于 2013-01-16T20:30:10.040 に答える