Neffman Posted December 27, 2009 Share Posted December 27, 2009 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. Link to comment https://forums.phpfreaks.com/topic/186462-quick-question-on-mulitdemensional-arrays/ Share on other sites More sharing options...
Catfish Posted December 27, 2009 Share Posted December 27, 2009 looks pretty good what you said. $i++ will increment. I think PHP is very similar syntax wise to C++ so you shouldn't take long to be used to it. i have no idea about PNG transparency though. never looked into any of that. Link to comment https://forums.phpfreaks.com/topic/186462-quick-question-on-mulitdemensional-arrays/#findComment-984629 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.