I'm super new at php, I'm working on a game in Unity c# and I'm trying to send and receive data from a mysql server. I think I'm having a problem with syntax. I basically have a string that's being sent from my c# script that holds multiple ships with their stats. The ships are seperated by zzz which is a string of it's stats separated by space. I'd like to be able to set the stats array within the ships array. This is what I have but it's not working. Thanks!!
$shiparraytobesplit = $_POST["shipinventory"];
$ships = explode("zzz", $shiparraytobesplit);
for($i = 0; $i<count($ships)-1; $i++)
{
$tempship[$i] = $ships[$i];
$tempshipinfo = explode(" ", $tempship);
for($ii = 0; $ii<count($tempshipinfo[!i])-1; $ii++)
{
//$shipinfo[$tempship][] = $info . '_' . $tempshipinfo;
$shipinfo[$ii] = $tempshipinfo[$ii];
}
echo $shipinfo[1];
}
I've tried a few variations but I can't seem to get it to work with this example. I'm probably missing something simple since I'm a total noob to php and kind of new to programming. Thanks again