Add onto an array with the key and value
<p>I've looked for days and to no avail. I can't find a function which could add to an array with the key and value. 
Here's why I need it: I need an array to store both the name of the owner and the type of the car. I'd like for the key to be the name of the owner and the type of the car to be the value and not have to use two arrays to contain something which one array can.</p>

<p>Here's my current code:<br />
<strong>Function used to get $vehicleName</strong></p>

<pre><code>function carName($nakedCarString)
{
    $cars=(separateString($array, $vehicleString));
    return $cars[0];
}
</code></pre>

<p>The above code uses a vehicle string, gets the name of the car with an array and returns the name of the car in a string. Not an array.<br />
<strong>Code(which requires code to add to array with key and value) which will be adding info to array</strong></p>

<pre><code>while($row = mysql_fetch_array($result))
  {
$vehicleString = $row['Vehicle'];
$vehicleName = carName($vehicleString);
$seller = steamID2CommunityID($row['Auctioneer']);
$name = new SteamAPI($seller);
$sellername = $name-&gt;getFriendlyName();
  }
</code></pre>

<p>The above code gets each row in a mysql table and foreach row it'd get the vehicle string, the name of the car from vehicle string using function above, the seller and the sellers name(in string, not array)
<br />
I'd need it so that it could add to an array($carIndex) with the key($sellername) and value($vehicleName). Any help?</p>
