Maybe UnSerialize
This was snagged from the Wordpress 2.0 source. Yayyy for Open Source!
function maybe_unserialize ( $original ) { if ( false !== $gm = @ unserialize($original) ) return $gm; else return $original; }
12390 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Chris Meller http://incoherentbabble.com
function maybe_unserialize ( $original ) { if ( false !== $gm = @ unserialize($original) ) return $gm; else return $original; }
// check to see if a string needs to be escaped for database input function escapeit ( $text ) { if ( get_magic_quotes_gpc() ) { $text = stripslashes($text); } if ( !is_numeric($text) ) { $text = mysql_real_escape_string($text); } return $text; }