Create a new array of array row 2

-1

I have an array of 30 rows and I want to get only index 1, this is $arr[1] , which I can already do. On the second line of my $arr[1] , I have student information. How do I get only that row and transform the space-separated values into a new array?

Array
(
    [Student ID] => 0
    [Student info] => McLol  CRN:Not Given  Subject:MAT  Course:2222 Section:Not Given  Desc:Research
    [Total Correct Responses] =>    
)
    
asked by anonymous 09.12.2018 / 20:34

1 answer

0

tenta isso:

Array
(
    [Student ID] => 0
    [Student info] => McLol  CRN:Not Given  Subject:MAT  Course:2222 Section:Not Given  Desc:Research
    [Total Correct Responses] =>    
)

$new_array = explode(" ",$arr[1]['Student info']); /*o primeiro parâmetro você define o delimitador no seu caso o espaço, 
e o segundo você a string que você quer analisar;*/
  

According to: link

    
09.12.2018 / 21:14