Revision: 43865
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at April 1, 2011 13:34 by frederichoule
Initial Code
function jsStrEncode($s, $r=true, $p="\\") { $c = array("¢"=>$p."242", "£"=>$p."243", "€"=>$p."244", "Â¥"=>$p."245", "°"=>$p."260", "¼"=>$p."274", "½"=>$p."275", "¾"=>$p."276", "¡"=>$p."241", "«"=>$p."253", "»"=>$p."273", "¿"=>$p."277", "À"=>$p."300", "Ã"=>$p."301", "Â"=>$p."302", "Ã"=>$p."303", "Ä"=>$p."304", "Ã…"=>$p."305", "Æ"=>$p."306", "Ç"=>$p."307", "È"=>$p."310", "É"=>$p."311", "Ê"=>$p."312", "Ë"=>$p."313", "ÃŒ"=>$p."314", "Ã"=>$p."315", "ÃŽ"=>$p."316", "Ã"=>$p."317", "Ã"=>$p."320", "Ñ"=>$p."321", "Ã’"=>$p."322", "Ó"=>$p."323", "Ô"=>$p."324", "Õ"=>$p."325", "Ö"=>$p."326", "Ø"=>$p."330", "Ù"=>$p."331", "Ú"=>$p."332", "Û"=>$p."333", "Ãœ"=>$p."334", "Ã"=>$p."335", "Þ"=>$p."336", "ß"=>$p."337", "à "=>$p."340", "á"=>$p."341", "â"=>$p."342", "ã"=>$p."343", "ä"=>$p."344", "Ã¥"=>$p."345", "æ"=>$p."346", "ç"=>$p."347", "è"=>$p."350", "é"=>$p."351", "ê"=>$p."352", "ë"=>$p."353", "ì"=>$p."354", "Ã"=>$p."355", "î"=>$p."356", "ï"=>$p."357", "ð"=>$p."360", "ñ"=>$p."361", "ò"=>$p."362", "ó"=>$p."363", "ô"=>$p."364", "õ"=>$p."365", "ö"=>$p."366", "ø"=>$p."370", "ù"=>$p."371", "ú"=>$p."372", "û"=>$p."373", "ü"=>$p."374", "ý"=>$p."375", "þ"=>$p."376", "ÿ"=>$p."377"); $x = strtr($s,$c); if ($r){ return($x); } else { print($x); } }
Initial URL
Initial Description
Initial Title
PHP String Encoder (for Javascript Alert, Confirm, etc.)
Initial Tags
javascript
Initial Language
PHP