Location: PHPKode > scripts > Email Robot > emailrobot/include/Message/MessageFormat1.php
<?php

//==================================================
// project: EMailRobot
// version: 0.2
// author: ilya nemihin (hide@address.com)
// date: 27-aug-2002
// url: www.nemilya.narod.ru/erobot/
//==================================================

/*

Parser of the message specific format:

message ::= line*
line ::= '$' fieldName ':' fieldValue nl
fieldName ::= [^$:]-nl
fieldValue ::= [^$:]-nl
nl ::= "\n"

*/

require_once('../include/Message/Message.php');

class MessageFormat1 extends Message{


function MessageFormat1(){
  $this->Message();

}

  function parse(){
    $_arr = explode( '$', $this->data );
    foreach( $_arr as $_line ){
      $_line = trim( $_line );
      if ( empty( $_line ) ) continue;
      $_arr2 = explode( ":", $_line );
      $this->setField( $_arr2[0], trim( $_arr2[1] ) );
    }
  }

}

?>
Return current item: Email Robot