-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

您应该阅读数组

//    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 回答