There are a number of ways to do this, objects are probably the most efficient. If you are not using objects anywhere else, don't bother with this. But here is how I would do it based off of what I know (this is not tested and is merely for methodical purposes)
Charicter Definitions:
Archer - speed: 10, attack: 15, range: 15, rateOfFire: 10, armor: 3
Swordsman - speed: 15, attack: 25, armor: 50
class.php
PHP Code:
class player
{
function _construct{
//pseudo code
foreach(name and value in $playerDefFile)
{
$playerSkills[name]=value;
}
public $playerName; //String
private $playerDefFile;
private $playerSkills as array('n/a'=>"speed", 'n/a'=>attack, 'n/a'=>"range", 'n/a'=>"rateOfFire", 'n/a'=>"armor", 'n/a'=>");
}
archer.def
Code:
speed: 10
attack: 15
range: 15
rateOfFire: 10
armor: 3
swordsman.def
Code:
speed: 15
attack: 25
armor: 50
This will make any non-used attributes equal to 'n/a' so the program can later on see if that attribute can be used. This also gives you a generic base for all your types of players so you can have multiple ones in an game (thus being a generic aproach) and you can add/modify players without any code changes (thus being an explansible one).
ps. I do have some experience in C++ game development, so I've programmed generic players before.