' ); if ( $valStart === FALSE ) return ""; $valStart += (strlen( $tag ) + 2); $valStop = mb_strpos( $text, '', $valStart ); if ( $valStop === FALSE ) return ""; $val = mb_substr( $text, $valStart, $valStop - $valStart ); return $val; } function parseUnicodeData( $buffer, &$table, $recTag, $recParser ) { global $currKey; // Initialize $table = array(); // Parse $recStartTag = '<'.$recTag.'>'; $recEndTag = ''; $recEndTagLen = mb_strlen( $recEndTag ); $recStart = mb_strpos( $buffer, $recStartTag ); while ( $recStart !== FALSE ) { $newRec = NULL; $recEndTagPos = mb_strpos( $buffer, $recEndTag, $recStart ); if ( $recEndTagPos !== FALSE ) { $recLen = ( $recEndTagPos + $recEndTagLen ) - $recStart; $newRec = $recParser( mb_substr( $buffer, $recStart, $recLen ) ); } if ( !empty( $currKey ) && $newRec != NULL ) $table[ $currKey ] = $newRec; $recStart = mb_strpos( $buffer, $recStartTag, $recStart + 1 ); } } ?>