"", "error" => "", "records" => array() ); $record = 0; continue; } if ( ereg( "^docstring=\"(.*)\"", $rawdata[$index], $match ) ) { $return[$cmd]["docstring"] = urldecode( $match[1] ); continue; } if ( ereg( "^error=\"(.*)\"", $rawdata[$index], $match ) ) { $return[$cmd]["error"] = urldecode( $match[1] ); continue; } $return[$cmd]["records"][$record++] = turf_record_parse( $rawdata[$index] ); } return $return; } function turf_record_parse( $line ) { $len = strlen( $line ); $out_string = ""; for ( $index = 0; $index < $len; ++$index ) { if ( $line[$index] == '{' ) { $out_string .= "array("; } elseif ( $line[$index] == '}' ) { $out_string .= ")"; } elseif ( $line[$index] == '(' ) { $out_string .= "array("; } elseif ( $line[$index] == '=' ) { $out_string .= "=>"; } else { $out_string .= $line[$index]; } } $out_string = ereg_replace( "([^ (,=]+)=", "\"\\1\"=", $out_string ); $out_string = ereg_replace( ", *)", ")", $out_string ); $out_string = ereg_replace( ", *$", "", $out_string ); eval( "\$struct = array( " . $out_string . " );" ); turf_urldecode( $struct ); return $struct; } ?>