Put user list in 2d array

Hello,

For a current application I am working on, I want to retrieve a list of users from a php website. The website currently displays the following as a user list:

Name1 | Email1 | Status1 | Name2 | Email2 | Status2 | Name3 | Email3 | Status3 |

Now what I would like to achieve is to put this information in an array, so I could just print ( for example ) the email adress of user 2.

I am able to put it into a built in array using the following:

public string[]		userInfo;

WWW hs_get = new WWW( post_url ); 	
userInfo = hs_get.text.Split("|"[0]); 	// put the information of the user in an array

It currently puts every word before a “|” into a new row.

I’ve been busy trying to use a 2d array, but I’m new to this and I cannot seem to figure it out. I have the following so far:

string[ , ] userInfo = new string[3,3];
   WWW hs_get = new WWW( post_url );  

I have no idea how to put the hs_get.text into this array now. It would be great to make it the following:

userInfo[0,1] = Name1, userInfo[0,2] = Email1, userinfo[0,3] = Status1
userinfo[1,1] = Name2, userInfo[1,2] = Email2, userInfo[1,3] = Status2

etc.

I have no idea if I’m on the right track or if this is the best way to do this, I’m fairly new with all this.

I hope I explained my problem well enough since english is not my native language.

Thanks in advance!

You could put your name etc into a struct and just read the data into that - would be much easier to follow after:

public struct UserInfo
{
	public string name;
	public string email;
	public string status;
	
}

public UserInfo []  userInfo;

public void GetData(string post_url)
{
	
	WWW hs_get = new WWW(post_url);   
	var data = hs_get.text.Split("|"[0]);
            var numUsers : int = Mathf.Floor(data.Length/3);
	userInfo = new UserInfo[numUsers];
	
	for (int i = 0, user = 0; user < numUsers && i+2 < data.Length; i+=3, user++)
	{
		userInfo[user].name = data*;*
  •   	userInfo[user].email = data[i + 1];*
    
  •   	userInfo[user].status = data[i + 2];*
    
  •   }*
    
  • }*