There is an alternative for getting text out of a blob that does not require as much code. Quoted from a handy online resource:
PHP offers natively the possibility of getting the BLOB data as a string.
For example ibase_fetch_assoc ( resource $result [, int $fetch_flag = 0 ] ) provides the $fetch_flag parameter which can be set to IBASE_TEXT, causing the function to return BLOB contents instead of BLOB ids.