143 posts
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Has been part of the Envato Community for over 5 years
+3 more
vanRijswijk says

Hello everybody,

I am currently working on an API system for a short url service, at this moment iam working on the QRcode section. Now heres my question:

If you look at bit.ly the have the following url for there qrcode.

http://bit.ly/#HASH_CODE#.qrcode

How do i filter .qrcode out of a url, i have searched many sites but could not find a solution.

Hope someone can help me with this. :)

296 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
CodeFusion says

Im not sure I understand you very well.

If you want to drop the qrcode
$original = "http://bit.ly/4nXvaN.qrcode";
echo '<a href="'.$original.'">'.$original.'</a><br />';

$new = str_replace(".qrcode","",$original);
echo '<a href="'.$new.'">'.$new.'</a><br />';

If you are wanting to get just the qrcode, it is not hidden in the url they give you. It is more likely in the database along side the original url. The ”.qrcode” attachment is most likely a trigger object.

I can imagine that they probably have a small script that reads the url, if .qrcode is present, then they return the qrcode instead of redirecting you to the original website.

Google offers a free qrcode service

http://code.google.com/apis/chart/docs/gallery/qr_codes.html

$your_link = "http://www.fremonttech.com";
echo '<a href="http://chart.apis.google.com/chart?chs=200x200&cht=qr&chl='.urlencode($your_link).'&choe=UTF-8">QR Code</a><br />';
echo '<img src="http://chart.apis.google.com/chart?chs=200x200&cht=qr&chl='.urlencode($your_link).'&choe=UTF-8" /><br />';
BTW , you can alter the size of the qrcode from bit.ly as well
http://bit.ly/4nXvaN.qrcode?s=800
143 posts
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Has been part of the Envato Community for over 5 years
+3 more
vanRijswijk says

Thanks for the reply i am looking into it.

by
by
by
by
by
by