title: sharing images on twitter using php
body: <pre><code>&lt;?php
      $title = urlencode('Nature'); 
      $url = urlencode('http://amazingpics.net/content/Nature/Amazing%20Nature%20698.jpg');
      $image = urlencode('http://trainees.ocs.org/training/hariharan/01-09-2014/images/img2.jpg');
  ?&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Sharing Images&lt;/title&gt;
  &lt;link href="css/share.css" rel="stylesheet" type="text/css" /&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;div class="all"&gt;
    &lt;div class="top"&gt;
    &lt;div class="nature" align="center"&gt;
    &lt;p class="nat"&gt;I LOVE NATURE&lt;/p&gt;
    &lt;/div&gt;
    &lt;p&gt;&amp;nbsp;&lt;/p&gt;
      &lt;div class="img"&gt;&lt;img src="images/img2.jpg" height="250" width="500" /&gt;&lt;/div&gt;
      &lt;div class="share"&gt;&lt;a onClick="window.open('http://www.facebook.com/sharer.php?s=100&amp;amp;p[title]=&lt;?php echo $title;?&gt;&amp;amp;p[url]=&lt;?php echo $url; ?&gt;&amp;amp;&amp;amp;p[images][0]=&lt;?php echo $image;?&gt;','sharer','toolbar=0,status=0,width=600,height=400');" href="javascript: void(0)"&gt;&lt;img src="images/share.png" width="200" height="40" /&gt;&lt;/a&gt;&lt;/div&gt;
      &lt;div class="share"&gt;&lt;a onClick="window.open('http://twitter.com/intent/tweet?url=&lt;?php echo $url;?&gt;','sharer','toolbar=0,status=0,width=600,height=400');" href="javascript: void(0)"&gt;&lt;img src="images/twitter.png" width="200" height="40" /&gt;&lt;/a&gt;&lt;/div&gt;
      &lt;p&gt;&amp;nbsp;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I tried the above code for sharing images on facebook and twitter. it works correctly in facebook, but the image cannot displayed in twitter. the link only displayed. please help me to share images on twitter in php. thanks in advance...</p>