PHP Error: unserialize() [function.unserialize]: Error at offset 118 of 512

Lately I got this error in my script while trying to decode serialized UTF-8 string:

unserialize() [function.unserialize]: Error at offset 118 of 512

Here’s a simple solution I found.

PHP: Nice URL shortener to use from PHP

In this post I would like to present you a nice URL shortening service that you may use from PHP in a very simple way (perhaps simplest possible!).
Let’s say you want to shorten url like this:
http://www.my-website-is-here.com/index.php?subpage
To do this you need this simple code:

$url = ‘http://www.my-website-is-here.com/index.php?subpage’;
$new_url = file_get_contents(‘http://is.gd/api.php?longurl=’ . urlencode($url));

Now you can echo $new_url to see [...]

 
TopOfBlogs Web Development & Design Blogs