I have a code to generate php code from an array of words, however the list of words is variable like:
$list=array(
"BMW",
"MUSTANG",
"DBM",
"Txt62"
);
$arrlength=count($list);
for($x=0;$x<$arrlength;$x++)
{
echo ' \'' .$list[$x]. '\'' . ' => $this->input->post("'.$list[$x].'") == \'\' ? \'Not defined definido\' : $this->input->post("'.$list[$x].'"), ';
echo "<br>";
}
Is there a better way to do it, like a function that I pass the array of words, and it returns php code?, Is this possible inside php code?