Parsing echo json_encode($row);

How do I parse this string in C# so I can break it up into separate variables?

I tried this but it did not work.

string[] parts = www.downloadHandler.text.Split('|');

                string guid = (parts[0]);
                string username = (parts[1]);
                int health = int.Parse(parts[2]);
                int level = int.Parse(parts[3]);
                int points = int.Parse(parts[4]);
                int killBonus = int.Parse(parts[5]);
                float killRate = float.Parse(parts[6]);
                float kills = float.Parse(parts[7]);
                float misses = float.Parse(parts[8]);

This is in the UnityWebRequest getting the "www.downloadHandler.text from the php file on the server.

How can I get these values separately and not in one string?

Here is the PHPcode echo.

echo ("GUID: ".$row['GUID']. PHP_EOL. "|Name: ".$row['userName']. PHP_EOL. "|Health: ".$row['health']. PHP_EOL. "|level: ".$row['level']. PHP_EOL. "|Points: ".$row['points']. PHP_EOL. "|Kill Bonus: ".$row['killBonus']. PHP_EOL. "|Kill Rate: ".$row['killRate']. PHP_EOL. "|Kills: ".$row['kills']. PHP_EOL. "|Misses: ".$row['misses']. PHP_EOL. ";");

I updated the OP, but I couldn’t update the subject.

You want to parse values, printed by this php string when it is executed on server, into separate variables?
For every labelled value, do something this:

   public string GetValue(string source, string label, int startIndex = 0)
   {
      var labelIndex = source.IndexOf(label, startIndex, StringComparison.Ordinal);
      if(labelIndex > -1) {
         var valueIndex = labelIndex + label.Length + 1 + ":".Length;
         var valueEndIndex = source.IndexOf("|", valueIndex, StringComparison.Ordinal);
         return source.Substring(valueIndex, valueEndIndex);
      }
      return "not found!";
   }

Written without checking by compiler, so might contain errors, but idea must be clear.

I got it by formatting the echo string a certain way…and was able to split it up nicely.