title: mailchimp api 2.0 subscribe through php?
body: <p>I need an example of how to subscribe a email address to mailchimp newsletter.</p>
  
  <p>Please check new api link here:
  <a href="https://bitbucket.org/mailchimp/mailchimp-api-php">https://bitbucket.org/mailchimp/mailchimp-api-php</a></p>
  
  <p>This is new malichimp api and I am not sure how to use it. :(</p>
  
  <p>For MailChimp 2.0 API, not for 1.3.</p>
  
  <p>Please somebody provide an example on how to subscribe user to mailchimp.</p>
  
  <p>Thank You.</p>
  
  <p>Edit1: Already tried following code, but not working:</p>
  
  <pre><code>$merge_vars = array('MM1'=&gt;$mm1);
  $MailChimp = new Mailchimp($apikey);
  $result = $MailChimp-&gt;call('lists/subscribe', array(
              'id'                =&gt; $listid,
              'email'             =&gt; array('email'=&gt;$email),
              'merge_vars'        =&gt; $merge_vars,
              'double_optin'      =&gt; false,
              'update_existing'   =&gt; true,
              'replace_interests' =&gt; false,
              'send_welcome'      =&gt; false,
          ));
      print_r($result);
  </code></pre>
  
  <p>But not working. Throwing following error:
  Fatal error: Call to a member function call() on a non-object in subscribe.php on line 22</p>