I try to display a php variable(include string, integer and \ / ( ) ,...
) into javascrip and dispaly through a text editore called FCKEditor.
but i faced but few bugs.
I tried to handel the bugs by using
$content = str_replace(array("\r", "\n", "\t"), '', $content);
$content = str_replace("'", "\'", $content);
$content = str_replace("", "\\", $content);
by using above function I am able to fix the bugs related to \ , \n
however still some bugs left for other character like "(".
is there any solution general javascript encode php?
My appricate for any help
Thanks,
Roozbeh
没有评论:
发表评论