Code: Select all
if (checkvarname($iterate[0])) {
$code = "\${$iterate[0]}";
array_shift($iterate);
foreach ($iterate as $readfile_value) {
if ($readfile_value == "") {
$code .= "[]";
} else {
$code .= "['$readfile_value']";
}
}
$code .= " = \$data;";
eval($code);
}Code: Select all
${$iterateї0]}ї$iterateї1]]ї$iterateї2]]ї$iterateї3]]... = $data;I have a few questions:
1. Is using eval() in this case evil? Is eval() evil in most cases?
2. Am I doing something wrong when I'm organizing my data this way? Should I just start using databases? How do you suggest I store data if I need to make direct changes to the database and them upload them to the site?
3. If this is the correct way of doing it (or semicorrect, for that matter), IS THERE A BETTER WAY?
Thanks. A minor note: Here's a sample of what this might parse:
Code: Select all
$sinf:supercategory:cage>original
$sinf:maincategory:cage>fiction
$sinf:creation:cage>2005.02.13
$sinf:update:cage>2005.02.13
$sinf:sc:s:cage>chtml
$sinf:injectstyle:cage:lyrics>font-style:italic;
$sinf:sc:t:cage>> "e;їїї"e; => "e;font-family:'Monotype
Corsiva',cursive,serif;font-size:16pt;text-align:center;"e;,
"e;==="e; => "e;font-style:italic;text-align:center;"e;
$sc:n:cage:1>Prologuefeyd | hey look ma,
Code: Select all
is online. [/color]