All pastes #741643 Raw Edit

Something

public text v1 · immutable
·published 2007-10-18 21:35 UTC
rendered paste body
<?php
header( 'Content-type: text/plain' );
$content = file_get_contents("compte.ofx" );

preg_match_all( "/<OFX>(.+)<\/OFX>/smUi", $content, $OFX );

$OFX = $OFX[ 1 ][ 0 ];
$N = new OFXNode( $OFX );
print_r( $N );

Class OFXNode
{       var $Tag;
        var $MarkUp;
        var $Nodes = array();
        function OFXNode( $MU )
        {
                $this -> MarkUp = $MU;

                preg_match( "/<(.+)>/smUi", $this -> MarkUp, $Match );
                preg_match( "/<". $Match[ 1 ]. ">(.+)<\/". $Match[ 1 ]. ">/smUi", $this -> MarkUp, $MatchContent );

                $Tag = $Match[ 1 ];
                $MarkUp = $MatchContent[ 1 ];

                echo $Tag. "\n";

                $Node = new OFXNode( $MarkUp );
        }
}
?>