protected static function extract_record($record, $prefix) {
        $result = [];
        $prefixlength = strlen($prefix);
        foreach ($record as $key => $value) {
            if (strpos($key, $prefix) === 0) {
                $result[substr($key, $prefixlength)] = $value;
            }
        }
        return (object) $result;
    }
protected static function extract_record($record, $prefix) {
        $result = [];
        $prefixlength = strlen($prefix);
        foreach ($record as $key => $value) {
            if (strpos($key, $prefix) === 0) {
                $result[substr($key, $prefixlength)] = $value;
            }
        }
        return (object) $result;
    }
protected static function extract_record ( $ record , $ prefix ) { $ result = [ ] ; $ prefixlength = strlen ( $ prefix ) ; foreach ( $ record as $ key => $ value ) { if ( strpos ( $ key , $ prefix ) === 0 ) { $ result [ substr ( $ key , $ prefixlength ) ] = $ value ; } } return ( object ) $ result ; }
Extract a record from another one.

@param object $record The record to extract from.
@param string $prefix The prefix used.
@return object
Extract a record from another one .