Getting Json to go into array php
<p>I've spent ages searching through the internet however I couldn't find a solution to this problem.</p>

<pre><code>$follow = $_GET['follow'];
$following = $_GET['following'];

session_start();

if(!empty($_SESSION['username'])){
$twitteroauth = new TwitterOAuth('MY PRIVATE CODE', 'MY PRIVATE CODE', $_SESSION['oauth_token'], $_SESSION['oauth_secret']);
}

$follow_timeline = $twitteroauth-&gt;get('followers/ids', array('screen_name' =&gt; $follow));
$following_timeline = $twitteroauth-&gt;get('friends/ids', array('screen_name' =&gt;     $following));

if (in_array($following, $follow_timeline)) {
echo "We found the word!";
}
</code></pre>

<p>It the data it from a json file. You can also read this. <a href="https://dev.twitter.com/docs/api/1/get/friends/ids" rel="nofollow">https://dev.twitter.com/docs/api/1/get/friends/ids</a> &amp; <a href="https://dev.twitter.com/docs/api/1/get/followers/ids" rel="nofollow">https://dev.twitter.com/docs/api/1/get/followers/ids</a>. It displays this error when I run the script written above.</p>

<pre><code>in_array() [function.in-array]: Wrong datatype for second argument in
</code></pre>

<p>And I thought about using json decode before the <code>if (in_array($following, $follow_timeline))</code> but it then displays this error.</p>

<pre><code>json_decode() expects parameter 1 to be string, object given in
</code></pre>

<p>Please can someone help. I just got started with php and I found it a bit confusing.</p>
