I would do it like this but I find no way of confirming this still is not screwing something up (just added the htmlspecialchars call).
ksort($string,SORT_STRING);
foreach($string as $k=>$v){
$current=str_replace("'","\'",$v);
$current=htmlspecialchars($current,ENT_NOQUOTES)
echo "$"."string['$k'] = '".$current."';\n";
}
I would do it like this but I find no way of confirming this still is not screwing something up (just added the htmlspecialchars call).
ksort($string,SORT_STRING);
foreach($string as $k=>$v){
$current=str_replace("'","\'",$v);
$current=htmlspecialchars($current,ENT_NOQUOTES)
echo "$"."string['$k'] = '".$current."';\n";
}