How to fetch Array keys from PHP in jQuery
<p>I'm new to jQuery and would like to know how I can fetch Array keys from a php file into jQuery.</p>

<p>I have this jQuery code to post input to <code>file.php</code> and exexute a query on every keyup.</p>

<p><code>file.php</code> echoes the result with the help of an Array what will look like:</p>

<pre><code>echo '&lt;li&gt;'.$row["name"].' '.$row["place"].' '.$row["year"].'&lt;/li&gt;';
</code></pre>

<p>The jQuery code is:</p>

<pre><code>$(document).ready(function() { //changes are possible when the page has fully loaded
    $('.inp').keyup(function() { //executes keyup function to the field class "inp"
        var inp = $(this).attr('value'); //sets a variable with the value of input from class="inp"
        $.post('ajax/file.php', {inp:inp}, function(data) { //posts that value to file.php as variable inp and executes the function (data) to this 
            $('.result').html(data);  //adds the returned result into HTML content as a first element in the set of class="result" =&gt; &lt;li&gt;

            $('.result li').click(function() { //executes click function when clicking li element
                var result_value = $(this).text(); //sets a variable and prepares something as text 
                $('.inp').attr('value', result_value); //fills value attribute of field class "inp" with the variable result_value
                $('.result').html(''); //clears li to ul class to hide the lists of results
            });
        });
    });
});
</code></pre>

<p>So when I click onto the <code>li</code> result it will be converted into text and the value attribute of the input field is filled with that.</p>

<p>To give an example:</p>

<pre><code>echo '&lt;li&gt;'.$row["name"].' '.$row["place"].' '.$row["year"].'&lt;/li&gt;';
</code></pre>

<p>will output: </p>

<pre><code>&lt;li&gt;ExAmpLE Home 2013&lt;/li&gt;
</code></pre>

<p>So when I click on <code>li</code> the new value of the input field is:</p>

<blockquote>
  <p>ExAmpLE Home 2013</p>
</blockquote>

<p>My question is how can I exlude specific Array keys like <code>$row["name"]</code> or <code>$row["year"]</code> from converting the result value into text from that click function so that the new value of the input field is:</p>

<blockquote>
  <p>ExAmpLE Home</p>
</blockquote>
