Moderator |
|
<?php
$invoer = "volledige health-give health, alle wapens-give weapons, volledige ammo-give ammo";
$cheat = array();
$cheat_lines = explode(", ", $invoer);
foreach($cheat_lines as $k => $v) {
$cheat_line = explode("-", $v);
$cheat[$k][0] = $cheat_line[0];
$cheat[$k][1] = $cheat_line[1];
}
echo "<pre>";
print_r($cheat);
echo "</pre>";
?>
<?php $invoer = "volledige health-give health, alle wapens-give weapons, volledige ammo-give ammo"; $cheat_lines = explode(", ", $invoer); foreach($cheat_lines as $k => $v) { $cheat[$k][0] = $cheat_line[0]; $cheat[$k][1] = $cheat_line[1]; } ?>
Je $invoer moet dan ook wel helemaal kloppen... |