Assign array element to variable in PHP

后端 未结 3 1633
野的像风
野的像风 2021-01-24 10:14

I know this is a silly question, but i\'m stucked! I have the following array:

Array ( [type] => 8 [message] => Use of undefined constant hola - assumed \'         


        
3条回答
  •  故里飘歌
    2021-01-24 10:55

    You can use:

    $var = $array['message'];
    

    In this case, message is your array index.

提交回复
热议问题