I have a PHP array with URL’s that I would like to keep hidden (or at least more difficult to copy)
I need to convert this array to a JS array.
Is it possible without writing the items in JS?
So NOT like in following example where the URL’s can be found in the source…
<?php
$arr = array("http://foo.com","http://bar.com","http://baz.com");
?>
<script>
var newArr = new Array("<?php echo implode(',' ,$arr); ?>");
</script>
If you want to make the urls unreadable you can encode each character to \xnn escape sequence:
the written javascript will look like this:
but will alert
http://foo.com