Posted By

robksawyer on 03/03/09


Tagged

php parse preg twitpic


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

kurokikaze
jeffgreco
muoto
BrianCoyDesign


TwitPic parser


 / Published in: PHP
 

  1. //Parse the status and look for twitpic url
  2. //http://twitpic.com/show/full/s0z4.jpg
  3. //http://twitpic.com/show/thumb/s0z4.jpg
  4. preg_match("%(http://twitpic\.com/)(.*$)%i",$twitter_status,$matches);
  5. $twitpic_url = $matches[1];
  6. $twitpic_code = $matches[2];
  7. //Display a thumbnail
  8. echo "<img src='$matches[1]/show/thumb/$matches[2].jpg' width='75'/><br/>";

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: fruehjahr on March 15, 2009

Hm, does not work for me

You need to login to post a comment.