Page 2 of 2

Posted: Sun Oct 30, 2005 12:15 pm
by Curtis782
I was looking at the code and thought it might have something to do with this?

Code: Select all

echo "<script type=\"text/javascript\">
var Descriptions = new Array();\n";
foreach ($description as $key => $value)
{
    echo "Descriptions[\'$key\'] = \'$value\'\n";
}
echo '</script>';

Posted: Mon Oct 31, 2005 12:21 am
by n00b Saibot
yeah! you are right! error lies there. the thing is you have descriptions which contains ' and the foreach loop is using ' to contain the value which messes up the array output. So you have to change line 5 to

Code: Select all

echo "Descriptions[\"$key\"] = \"$value\"\n";
though i sometimes use this :arrow:

Code: Select all

echo "Descriptions[\"".addslashes($key)."\"] = \"".addslashes($value)."\"\n";

Posted: Mon Oct 31, 2005 8:30 am
by feyd
var_export() works so much better at that ;)