Find value in array jQuery
<p>So I need to get the part of the array that is holding a specific id, so that I can use the other variables within it.</p>

<p>Here is my current code to create the array:</p>

<pre><code>&lt;?php foreach ($list_subjects as $subject): ?&gt;
    subjects.push({
        id: parseInt(&lt;?php echo $subject['subject_id']; ?&gt;),
        subject_name: "&lt;?php echo $subject['subject_name']; ?&gt;",
        course_type: "&lt;?php echo $subject['course_type']; ?&gt;",
        num_videos: parseInt(&lt;?php echo $subject['num_videos']; ?&gt;),
        subject_tag: "&lt;?php echo $subject['subject_tags']; ?&gt;"
    });
&lt;?php endforeach; ?&gt;
</code></pre>

<p>(I know mixing PHP in this fashion isn't good practise, but bear with me for this question)</p>

<p>This is the code I'm using to at least try and check if the value is in the array, but it is returning -1 every time, and the value of course_id IS in the array.</p>

<blockquote>
  <p>alert($.inArray(course_id, subjects.id));</p>
</blockquote>

<p>Why is this happening?</p>
