PHP – Using oEmbed API to Embed Videos

Post Thumbnail of PHP - Using oEmbed API to Embed Videos

oEmbed is a format for allowing an embedded representation of a URL on third party sites. Which means, if we have a video page’s URL, we can easily get the video thumbnail photo, video title, HTML code to embed it in our website and more. But of course, the video site must have oEmbed support in order for us to do that.

Filed in Web Development
Posted on 30 January 2012 • 0 comment

PHP MySQL – Get Next Auto Increment Value of a Table

Post Thumbnail of PHP MySQL - Get Next Auto Increment Value of a Table

We do not often need this but sometimes when we need to retrieve the next auto increment value of a table (without incrementing the auto increment value of course), this solution below will help.

Filed in Web Development
Posted on 14 January 2012 • 0 comment

PHP Smart Date Function – Display Time Elapsed (Difference) Based on a Given Timestamp

Post Thumbnail of PHP Smart Date Function - Display Time Elapsed (Difference) Based on a Given Timestamp

As a web developer, we often need to display dates in our website. As a web user myself, I don’t like to read full dates like “26 November 2011 11:30PM” because it takes me a little while to interpret the date. I prefer reading smart dates like “1 hour ago” or “6 months ago”. Therefore, here I wrote a quick and simple function in PHP that display the time difference/elapsed based on a given timestamp value.

Filed in Web Development
Posted on 12 December 2011 • 0 comment

URL Canonicalization (Canonization) Using PHP

Post Thumbnail of URL Canonicalization (Canonization) Using PHP

When your website can be accessed via several URLs, such as http://www.example.com & http://example.com, you might want to decide a best URL and use only that URL whenever you link back to your site, because this helps your site in terms of SEO.

Filed in SEO, Web Development
Posted on 13 February 2011 • 0 comment

PHP Function to Auto Convert URL into Clickable Hyperlink (Anchor <a> Tag)

Post Thumbnail of PHP Function to Auto Convert URL into Clickable Hyperlink (Anchor &lt;a&gt; Tag)

In wordpress, if you want to auto convert all URLs in your string into clickable hyperlinks, you can actually do it using the built-in function make_clickable(). If you need to do that outside of wordpress, you can refer to the function’s source code at..

Filed in Web Development
Posted on 2 September 2009 • 17 comments