Skip to content

tweet image is not showing. #3

Description

@asifrafeeq

my code is like this below, I am following your example, but it doesn't show the image, although it is showing the tweet text.

echo "<ul>";
foreach ($user_timeline as $user_tweet) {
  echo "<li>";
  echo TwitterTextFormatter::format_text($user_tweet) . "<br/>";
  // Print also the tweet's image if is set
  if (isset($user_tweet->entities->media)) {
    $media_url = $user_tweet->entities->media[0]->media_url;
    echo "<img src='{$media_url}' width='150px' />";
  }
  echo "</li>";
}
echo "</ul>";

please help.. thanks a lot in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions