Sending array from php to javascript, parsing PHP variables to JS
<p>I want to be able to pickup variables from php example: <code>public var $PHPVariable = "Hello World";</code> or something in that way. But how will I possible send this to javascript without XML HTTP(S) requests?</p>

<p>PHP File example</p>

<pre><code>&lt;?php

    public var $secure_connection = $secure['ssl']['type']['connection']['valid_id'] // This is equal to (int)25
    public var $userRank = $_SESSION['user']['active']['secure']['rank']; // Returns Admin or Default
    public var $userFullName = $_SESSION['user']['unactive']['secure']['require']['name']['first'.'middle'.'last']
?&gt;
</code></pre>

<p>JavaScript file / document</p>

<pre><code>function get(variable, type){
    if(!empty(variable) &amp;&amp; !empty(type)){
        if(!exist(variable)){ // the exist function will check if the public variable exist in the php setting file.
            return 'The variable does not exist!';
        }
        if(type=='output'){
            return recieve(variable, 'As String'); // the recieve function will collect the data from the public variable.
        }
        if(type=='setting'){
            return recieve(variable, 'As Setting') // returning the recieve function as a setting will basicly mean it can return anything such as string/array/integer/boolean
        }
    }else{
        return 'ERROR: Please fill in required fields!';
    }
}
if(get('secure_connection', 'setting')==25){/* Returns true */}
if(get('userRank', 'setting')=='Admin'){/* Returns true */}
if(get('userFullName', 'output')){/* Returns the variable as a string no matter what the php variable was in ex int/boolean*/}
</code></pre>

<blockquote>
  <p>Take in mind I want to do this without XML http(s) requests!</p>
</blockquote>

<p>Thanks for taking your time help! Richard.</p>

<p><strong>EDIT</strong></p>

<hr>

<p>I know it is possible sending JSON Requests to a PHP Object class, which could solve this solution but it is not secure enough for my website, though it allows the user to even edit their own rank into other ranks or change SQL Connection properties of databases and change the row values, etc. Just with enough knowledge of using the (example) Chrome Console to use the function to change the php files content. Which will result resolving no ones problems.</p>