Jump to content

Quick question on mulitdemensional arrays


Neffman

Recommended Posts

Ok so first off im a coding noob!!! But heres what i have right now.

 

function fillCharData($url)
{
$charData = simplexml_load_file($url); 
$tempCharArray = array(0,1,2,3,4,5);
$tempCharArray[0] = $charData->name;
$tempCharArray[1] = $class_name[(int)$charData->classid];
$tempCharArray[2] = $charData->exp;
$tempCharArray[2] = (int)$tempCharArray[2];
$tempCharArray[3] = $charLvl->level;
$tempCharArray[4] = $charData->mqpasses;
$tempCharArray[5] = $charData->mqattempts;
}

 

Except i want to bypass this temp array and just go straight into a multiarray. So my thoughts are

 

$charArray[$i][0] = $charData->name;
$charArray[i][1] = $class_name[(int)$charData->classid];
blah
blah
$i = $i +1;

 

So i guess my question is, is that how i do it? I dont know php very well. What i have learned is in C++ and im just trying to carry it over.

 

Also is there an easier way to increment? $i++; ?

 

Also i am using this to write it on a png using gd librarys. But im wondering how to create transparency? Any special way?

 

Thanks again for looking this over.

Thanks for looking this over and ill have more help for you guys later.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.