title: Fatal Error: Call to undefined function curl()
body: <p>This is my code below for a twiiter app.
  I tried to rectify the error but to no avail</p>
  
  <blockquote>
    <p>Fatal error: Call to undefined function curl() in C:\wamp\www\tweet\twitter.php on line 47</p>
  </blockquote>
  
  <p>What do I have to edit in my code?</p>
  
  <pre><code>&lt;?php
  require_once('TwitterAPIExchange.php');
  
  $settings = array(
      'oauth_access_token' =&gt; "",
      'oauth_access_token_secret' =&gt; "",
      'consumer_key' =&gt; "",
      'consumer_secret' =&gt; ""
  );
  
  $url = "https://api.twitter.com/1.1/statuses/user_timeline.json";
  
  $requestMethod = "GET";
  
  if (isset($_GET['user']))  {$user = $_GET['user'];}  else {$user  = "iagdotme";}
  if (isset($_GET['count'])) {$user = $_GET['count'];} else {$count = 20;}
  
  $getfield = "?screen_name=$user&amp;count=$count";
  $twitter = new TwitterAPIExchange($settings);
  $string = json_decode($twitter-&gt;setGetfield($getfield)
  -&gt;buildOauth($url, $requestMethod)
  -&gt;performRequest(),$assoc = TRUE);
  
  if (is_array($string)) 
  {
      foreach($string as $items)
      {
          echo "Time and Date of Tweet: ".$items['created_at']."&lt;br /&gt;";
          echo "Tweet: ". $items['text']."&lt;br /&gt;";
          echo "Tweeted by: ". $items['user']['name']."&lt;br /&gt;";
          echo "Screen name: ". $items['user']['screen_name']."&lt;br /&gt;";
          echo "Followers: ". $items['user']['followers_count']."&lt;br /&gt;";
          echo "Friends: ". $items['user']['friends_count']."&lt;br /&gt;";
          echo "Listed: ". $items['user']['listed_count']."&lt;br /&gt;&lt;hr /&gt;";
      }
  }
  
  $api = "http://api.twitter.com/1/users/show.xml?screen_name=";
  $users = file("users.txt", FILE_IGNORE_NEW_LINES);
  
  $i = 0;
  if (is_array($users))
  {
      foreach($users as $user)
      {
          $data = curl("$api$user");
          preg_match("#&lt;description&gt;(.*?)&lt;/description&gt;#is", $data, $matches);
          $bio[$i]["user"] = $user;
          $bio[$i]["description"] = $matches[1];
          $i++;
      }
  
      function curl($url)
      {
          $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, $url);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
          curl_close($ch);
          return curl_exec($ch);
      }
  
  }
  </code></pre>