Login   Register  
PHP Classes
elePHPant
Icontem

File: examples/file.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Everton da Rosa  >  Txt Xtrator  >  examples/file.php  >  Download  
File: examples/file.php
Role: Example script
Content type: text/plain
Description: exemplo de script
Class: Txt Xtrator
Convert data from CSV to other text based formats
Author: By
Last change:
Date: 3 years ago
Size: 567 bytes
 

Contents

Class file image Download
<?php
/*
 * TxtXtrator - arquivo de exemplo
 * Mostra como utilizar o método file()
 */
function noSpace($string){
    
$string trim($string);
    return 
$string;
}

require 
'../TxtXtrator.class.php';
$TxtXtrator = new TxtXtrator();
$filename 'CREDOR.TXT';
$TxtXtrator->loadFile($filename);
$TxtXtrator->loadTpl('credor.json');
$TxtXtrator->setCsvSeparator(';');
$TxtXtrator->xtract();
$TxtXtrator->setOutputType('csv');
$TxtXtrator->setLineBreakType('windows');
$TxtXtrator->output();
$TxtXtrator->file('exemplo.txt');

echo 
file_get_contents('exemplo.txt');
?>